Idea中 修改 servlet模板

点击左上角的File:
Setting --> Editor --> File and Code Templates --> Other --> web --> Servlet.class
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

#parse("File Header.java")
public class ${Class_Name} extends javax.servlet.http.HttpServlet {
    @Override
    protected void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException {

    }
    @Override
    protected void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException {

    }
}

 

点击左上角的File:
Setting --> Editor --> File and Code Templates --> Includes--> File header
/**
 * @Description TODO
 * @ClassName ${Class_Name}
 * @author:  ${Name}
 * @date: ${DATE} ${TIME}
 * @Version V1.0
 */

 

你可能感兴趣的:(软件实用专栏)