zoukankan      html  css  js  c++  java
  • myeclipse中修改servlet的模板代码

    #---------------------------------------------#
    # <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(req,resp);
        }
     
    </aw:method>
     
    <aw:method name="doPut">
        public void doPut(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
     
            // Put your code here
        }
     
    </aw:method>
     
    <aw:method name="doDelete">
        public void doDelete(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
     
            // Put your code here
        }
     
    </aw:method>
     
    <aw:method name="init">
        public void init() throws ServletException {
            // Put your code here
        }
     
    </aw:method>
     
    <aw:method name="destroy">
        /**
         * Destruction of the servlet. <br>
         */
        public void destroy() {
            super.destroy(); // Just puts "destroy" string in log
            // Put your code here
        }
     
    </aw:method>
     
    <aw:method name="getServletInfo">
        public String getServletInfo() {
            return "This is my default servlet created by Eclipse";
        }
     
    </aw:method>
     
    描述:找到这个路径下的MyEclipseCommonplugins的com.genuitec.eclipse.wizards_8.5.0.me201003052220.jar,我用的是myeclipse8.5,用解压缩软件打开,并修改添加进去既可,templates文件夹里全部是模板代码,你可以任意疯狂了,修改里面的废物代码,利用搜索servlet.java就是你要修改的
  • 相关阅读:
    Java 的Throwable、error、exception的区别
    最长回文子序列和最长回文子串
    牛客练习赛40 C-小A与欧拉路
    判断一棵树是否为二叉搜索树,完全二叉树和二叉平衡树
    Java语言的特点和特性
    设计模式
    联合索引和单列索引
    如何优化sql查询
    数据库的范式和约束
    数据库事务ACID和事务的隔离级别
  • 原文地址:https://www.cnblogs.com/qq809306794/p/3175720.html
Copyright © 2011-2022 走看看