myEclipse中 学习视频 新建Servlet 类的子类。
但是每次建立出来 选择继承doget 和dopost方法 出来很多 多余的代码 和注释 。
请问有没有办法 把 注释去除掉 ?
问题如下public class ServletTest extends HttpServlet { /**
* The doGet method of the servlet. <br>
*
* This method is called when a form has its tag value method equals to get.
*
* @param request the request send by the client to the server
* @param response the response send by the server to the client
* @throws ServletException if an error occurred
* @throws IOException if an error occurred
*/
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException { response.setContentType("text/html");
PrintWriter out = response.getWriter();
out
.println("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">");
out.println("<HTML>");
out.println(" <HEAD><TITLE>A Servlet</TITLE></HEAD>");
out.println(" <BODY>");
out.print(" This is ");
out.print(this.getClass());
out.println(", using the GET method");
out.println(" </BODY>");
out.println("</HTML>");
out.flush();
out.close();
}
但是每次建立出来 选择继承doget 和dopost方法 出来很多 多余的代码 和注释 。
请问有没有办法 把 注释去除掉 ?
问题如下public class ServletTest extends HttpServlet { /**
* The doGet method of the servlet. <br>
*
* This method is called when a form has its tag value method equals to get.
*
* @param request the request send by the client to the server
* @param response the response send by the server to the client
* @throws ServletException if an error occurred
* @throws IOException if an error occurred
*/
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException { response.setContentType("text/html");
PrintWriter out = response.getWriter();
out
.println("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">");
out.println("<HTML>");
out.println(" <HEAD><TITLE>A Servlet</TITLE></HEAD>");
out.println(" <BODY>");
out.print(" This is ");
out.print(this.getClass());
out.println(", using the GET method");
out.println(" </BODY>");
out.println("</HTML>");
out.flush();
out.close();
}
解决方案 »
- jsf工程加入ajax4jsf-1.1.0.jar之后 tomcat启动报错,求解。
- 怎么给web系统加上权限管理
- 【急】关于站点路径的问题..
- 用户对网页载入速度的忍耐度?
- 有个程序,不知怎么错了
- 请问如何使页面的"返回Button"能根据来自不同的接入页面到达该页面时,可以返回不同的页面。谢谢!
- tomcat如何虚拟主机,在线给分
- 知道客户机上的绝对路径,怎么样把文件上传到服务器上呢?
- MyEclipse部署web项目按钮没反应
- httpclient做文件中转,服务端报错
- org.apache.jasper.JasperException: Unable to compile class for JSP
- servlet
throws ServletException, IOException { }
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException { }}
A、把Servlet.java解压出来
B、用文本编辑工具打开,去掉其中不需要的注释和冗余代码即可 4、在templates目录下还存在html、xhtml、jsp、xml文件夹分别放着他们各自的代码模版 5、重启myeclipse