Eclipse中servlet简易模版
Posted 天之骄子zz
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Eclipse中servlet简易模版相关的知识,希望对你有一定的参考价值。
1 package ${enclosing_package}; 2 3 import java.io.IOException; 4 import javax.servlet.ServletException; 5 import javax.servlet.http.HttpServlet; 6 import javax.servlet.http.HttpServletRequest; 7 import javax.servlet.http.HttpServletResponse; 8 9 10 public class ${primary_type_name} extends HttpServlet { 11 private static final long serialVersionUID = 1L; 12 13 protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { 14 request.setCharacterEncoding("UTF-8"); 15 response.setContentType("text/html; charset=UTF-8"); 16 } 17 18 protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { 19 doGet(request, response); 20 } 21 22 }
以上是关于Eclipse中servlet简易模版的主要内容,如果未能解决你的问题,请参考以下文章