补充:修改Myeclipse的servlet模板
来源:互联网 发布:和讯网个股数据 编辑:程序博客网 时间:2024/05/16 19:54
原Servlet模板实例
<span style="margin: 0px; padding: 0px; border: 0px; font-size: 18px; background: transparent;">package www.csdn.net.servlet;import java.io.IOException;import java.io.PrintWriter;import javax.servlet.ServletException;import javax.servlet.http.HttpServlet;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;public class First extends HttpServlet {/** * Constructor of the object. */public First() {super();}/** * Destruction of the servlet. <br> */public void destroy() {super.destroy(); // Just puts "destroy" string in log// Put your code here}/** * 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();}/** * The doPost method of the servlet. <br> * * This method is called when a form has its tag value method equals to post. * * @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 doPost(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 POST method");out.println(" </BODY>");out.println("</HTML>");out.flush();out.close();}/** * Initialization of the servlet. <br> * * @throws ServletException if an error occurs */public void init() throws ServletException {// Put your code here}}</span>
怎样在建Servlet时去掉所有的注释:
先找到MyEclipse安装到哪
(1)右击MyEclipse
(2)复制目标(T)的路径,然后粘在计算机路径下进行搜索
(3)点击plugins文件
(4)搜寻这个文件
(5)打开文件找模版templates在template下再找servlet.java
(6)打开servlet.java在里面删除所有的注解
(7)在重新启动工具MyEclipse(注),在建一个新的servlet文件
0 0
- 补充:修改Myeclipse的servlet模板
- 修改 MyEclipse 的servlet 模板
- 修改MyEclipse的servlet模板
- MyEclipse Servlet 模板修改
- MyEclipse 修改servlet模板
- MyEclipse 修改servlet模板
- MyEclipse 修改Servlet模板
- myeclipse修改servlet模板
- MyEclipse修改Servlet模板
- 修改MyEclipse的Servlet的生成模板
- myeclipse中修改servlet的模板代码
- 修改MyEclipse默认的Servlet代码模板
- Myeclipse怎样修改servlet模板
- 修改MyEclipse中servlet模板
- Myeclipse修改servlet模板教程
- 2、修改MyEclipse中生成的模板servlet的方法
- Myeclipse中修改servlet JSP等模板的方法
- 如何在myeclipse中自定义修改servlet的模板
- Xcode6设置ARC
- LINK : warning LNK4098: 默认库“LIBCMTD”与其他库的使用冲突;请使用 /NODEFAULTLIB:library
- JProfiler学习笔记
- spring3使用task注记及task:annotation-driven解决定时问题
- 关于jeesite的陷阱需要注意
- 补充:修改Myeclipse的servlet模板
- Mybatis 相关知识(一)
- JAVA STRING FORMAT 简介
- Eclipse开发Android程序引入第三方jar包的方法
- 常用sql语句
- 算法(二)—分治法Divide-and-conque
- UVA 494-Kindergarten Counting Game
- C++之常量与指针
- HDU 5318(The Goddess Of The Moon-矩阵乘法)[Template:矩阵]