IDEA Servlet 模板設(shè)置的方法
IDEA Servlet 模板
1. 打開模板設(shè)置
2. 替換模板內(nèi)容
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != '')package ${PACKAGE_NAME};#end#parse('File Header.java')@javax.servlet.annotation.WebServlet('/${Class_Name}')public class ${Class_Name} extends javax.servlet.http.HttpServlet { protected void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException { this.doPost(request,response); } protected void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException { }}
3. 新建 Servlet
4. 效果輸入類名即可自動(dòng)創(chuàng)建 Servlet 文件:
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;@WebServlet('/Servlet')public class Servlet extends HttpServlet { protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { this.doPost(request, response); } protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { }}
總結(jié)
到此這篇關(guān)于IDEA Servlet 模板設(shè)置的方法的文章就介紹到這了,更多相關(guān)IDEA Servlet 模板設(shè)置內(nèi)容請(qǐng)搜索好吧啦網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持好吧啦網(wǎng)!
相關(guān)文章:
1. XML入門的常見問題(三)2. HTTP協(xié)議常用的請(qǐng)求頭和響應(yīng)頭響應(yīng)詳解說明(學(xué)習(xí))3. XML 非法字符(轉(zhuǎn)義字符)4. XML在語(yǔ)音合成中的應(yīng)用5. .NET Core 分布式任務(wù)調(diào)度ScheduleMaster詳解6. jscript與vbscript 操作XML元素屬性的代碼7. 不要在HTML中濫用div8. .NET Framework各版本(.NET2.0 3.0 3.5 4.0)區(qū)別9. ASP將數(shù)字轉(zhuǎn)中文數(shù)字(大寫金額)的函數(shù)10. HTML5實(shí)戰(zhàn)與剖析之觸摸事件(touchstart、touchmove和touchend)
