码迷,mamicode.com
首页 > 系统相关 > 详细

Eclipse中servlet简易模版

时间:2017-10-18 01:59:18      阅读:163      评论:0      收藏:0      [点我收藏+]

标签:har   serial   oid   style   tco   http   end   htm   pac   

 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简易模版

标签:har   serial   oid   style   tco   http   end   htm   pac   

原文地址:http://www.cnblogs.com/ixan/p/7684633.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!