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. 效果輸入類名即可自動創(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)容請搜索好吧啦網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持好吧啦網(wǎng)!
相關(guān)文章:
1. 以PHP代碼為實例詳解RabbitMQ消息隊列中間件的6種模式2. AJAX實現(xiàn)文件上傳功能報錯Current request is not a multipart request詳解3. ASP常用日期格式化函數(shù) FormatDate()4. vue-electron中修改表格內(nèi)容并修改樣式5. 微信小程序?qū)崿F(xiàn)商品分類頁過程結(jié)束6. 推薦一個好看Table表格的css樣式代碼詳解7. 不使用XMLHttpRequest對象實現(xiàn)Ajax效果的方法小結(jié)8. 基于Surprise協(xié)同過濾實現(xiàn)短視頻推薦方法示例9. PHP獲取時間戳等相關(guān)函數(shù)匯總10. ASP新手必備的基礎(chǔ)知識
