修改servlet模版
打开安装myeclipse的安装路径—common—plugins—搜索*wizard*
修改:
拷贝一份到桌面—用rar文件的方式打开—templates—Servlet.java(创建servlet的时候的模版)---右击查看文件--
查看文件不能直接修改,先放到桌面改好之后再复制回去
把注释和其他方法都删掉 只保留doGet和doPost方法
#---------------------------------------------#
# <aw:description>Template for Servlet</aw:description>
# <aw:version>1.1</aw:version>
# <aw:date>04/05/2003</aw:date>
# <aw:author>Ferret Renaud</aw:author>
#---------------------------------------------#
<aw:import>java.io.IOException</aw:import>
<aw:import>java.io.PrintWriter</aw:import>
<aw:import>javax.servlet.ServletException</aw:import>
<aw:import>javax.servlet.http.HttpServlet</aw:import>
<aw:import>javax.servlet.http.HttpServletRequest</aw:import>
<aw:import>javax.servlet.http.HttpServletResponse</aw:import>
<aw:parentClass>javax.servlet.http.HttpServlet</aw:parentClass>
<aw:method name="doGet">
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
}
</aw:method>
<aw:method name="doPost">
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
doGet(request,response);
}
</aw:method>
蓝底为增加的内容,修改后找到把原来的覆盖掉就可以了,重启myeclipse,重启tomcat