STRP1 点击setting
STEP2 搜索 code te ** 就会出现 File and code Templates
STEP3 根据需求修改 servlet 模板
例如: ${Entity_Name} 就是你起得文件名字啦.
注意不要写错啦!~
#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);
}
}
修改成功后再创建就会做更改啦!
1.新建一个servlet , 快捷键command+N
2.起一个名字就可以了
然后界面就是这样的: