一.首先打开eclipse,创建一个项目
Servlet的创建及使用 -- hello world
二.在项目中创建关于servlet的包
Servlet的创建及使用 -- hello world
三.配置xml
Servlet的创建及使用 -- hello world

四.在包内创建类并继承Httpservlet类,重写service方法
Servlet的创建及使用 -- hello world
response.setContentType(“text/html;charset=utf-8”);这个用于解决页面的中文乱码问题,然后用response.getWriter().print(“hello,world”);就OK了。

相关文章: