IDEA Servlet 模板設(shè)置的方法
IDEA Servlet 模板
1. 打開(kāi)模板設(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. idea設(shè)置提示不區(qū)分大小寫(xiě)的方法2. 使用AJAX(包含正則表達(dá)式)驗(yàn)證用戶登錄的步驟3. Java PreparedStatement用法詳解4. Java實(shí)現(xiàn)的迷宮游戲5. django queryset相加和篩選教程6. IDEA 2020.1.2 安裝教程附破解教程詳解7. Java利用TCP協(xié)議實(shí)現(xiàn)客戶端與服務(wù)器通信(附通信源碼)8. JS圖片懶加載庫(kù)VueLazyLoad詳解9. 利用ajax+php實(shí)現(xiàn)商品價(jià)格計(jì)算10. Spring如何集成ibatis項(xiàng)目并實(shí)現(xiàn)dao層基類封裝

網(wǎng)公網(wǎng)安備