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. Django ORM實(shí)現(xiàn)按天獲取數(shù)據(jù)去重求和例子2. Jsp中request的3個(gè)基礎(chǔ)實(shí)踐3. XML入門(mén)的常見(jiàn)問(wèn)題(一)4. jsp EL表達(dá)式詳解5. 解決ajax的delete、put方法接收不到參數(shù)的問(wèn)題方法6. IntelliJ IDEA 統(tǒng)一設(shè)置編碼為utf-8編碼的實(shí)現(xiàn)7. idea修改背景顏色樣式的方法8. chat.asp聊天程序的編寫(xiě)方法9. IntelliJ IDEA設(shè)置自動(dòng)提示功能快捷鍵的方法10. 怎樣才能用js生成xmldom對(duì)象,并且在firefox中也實(shí)現(xiàn)xml數(shù)據(jù)島?
