zoukankan      html  css  js  c++  java
  • IntelliJ IDEA 2017.3-----修改servlet模板

    原来的

    #if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end
    #parse("File Header.java")
    @javax.servlet.annotation.WebServlet(name = "${Entity_Name}")
    public class ${Class_Name} extends javax.servlet.http.HttpServlet {
        protected void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException {
    
        }
    
        protected void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException {
    
        }
    }

    创建出来后的效果

    package cn.itcast.cookie;
    
    import javax.servlet.ServletException;
    import javax.servlet.annotation.WebServlet;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import java.io.IOException;
    
    /**
     * @author 旗木五五开
     * @create 2020-03-23 16:31
     */
    @WebServlet(name = "CookieDemo1")
    public class CookieDemo1 extends HttpServlet {
        protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    
        }
    
        protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    
        }
    }

    修改后的

    #if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end
    #parse("File Header.java")
    @javax.servlet.annotation.WebServlet("/${Entity_Name}")
    public class ${Class_Name} extends javax.servlet.http.HttpServlet {
        protected void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException {
    
        }
    
        protected void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException {
            this.doPost(request,response);
        }
    }

     修改后的效果

    package cn.itcast.cookie;
    
    import javax.servlet.ServletException;
    import javax.servlet.annotation.WebServlet;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import java.io.IOException;
    
    /**
     * @author 旗木五五开
     * @create 2020-03-23 16:55
     */
    @WebServlet("/CookieDemo1")
    public class CookieDemo1 extends HttpServlet {
        protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    
        }
    
        protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
            this.doPost(request, response);
        }
    }
  • 相关阅读:
    白名单执行payload之rundll32
    java.lang.NoClassDefFoundError: com/fasterxml/jackson/databind/JsonNode
    Redis key过期监听
    Kafka拦截器
    常用工具类
    Redis Pipelining
    Redis 发布订阅(Pub/Sub)
    Redis Stream
    模拟Spring自实现监听器
    Jackson
  • 原文地址:https://www.cnblogs.com/rijiyuelei/p/12553257.html
Copyright © 2011-2022 走看看