Servlet.java源代码想要修改的步骤,与低版本的不同废话少说,直接来步骤:

1,在myEclipse的安装目录中搜索com.genuitec.eclipse.wizards文件,如图:选择com.genuitec.eclipse.wizards_11.0.0.me201303311935.jar文件,用winrar

打开

2,找到里面的Servlet.java文件,然后修改就可以了。PS:直接打开不好修改的话,可以把代码放到MyEclipse中修改,改完以后再放到Servlet.java中去,直接将

原来的Servlet.java文件替换就可以了,我的代码是改过的,可以直接复制粘贴

代码如下:

#---------------------------------------------#
# <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:constructor name="c1">
/**
* Constructor of the object.
*/
public <aw:className/>() {
super();
}

</aw:constructor> 
 
<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>

05-10 23:46