1.在Eclipse中创建Dynamic Web Project.
2.一路next,在“Configure web module settings.”中勾选Generate web.xml deployment descriptor选项,在WebContent/WEB-INF目录中,生成web.xml
3.随便拷贝一个index.htm文件,放在
WebContent,作为welcome-file,用于展示启动页
4.
web.xml中servlet和servlet-mapping标签,要注意写对;两个标签中的子标签值
<servlet-name>
必须相同
5.子类重写doGet或doPost等方法,即去掉super.doGet(request, response)和super.doPost(request, response)