美文网首页
IDEA Servlet模板

IDEA Servlet模板

作者: 随心者随心行 | 来源:发表于2018-05-07 08:50 被阅读0次

      #if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end
      #parse("File Header.java")
      @javax.servlet.annotation.WebServlet(name = "${Entity_Name}",urlPatterns="/${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 {
       //设置查询码表
       response.setCharacterEncoding("UTF-8");
       //通过一个头告知浏览器要用特定的编码。
        response.setHeader("Content-Type","text/html;charset=UTF-8");
       
    }
    
    protected void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException {
          doPost(request,response);
    }
    }
    

    相关文章

      网友评论

          本文标题:IDEA Servlet模板

          本文链接:https://www.haomeiwen.com/subject/hefmrftx.html