Servlet1.java
资源名称:某公司的java培训教材 [点击查看]
上传用户:dinglihq
上传日期:2013-02-04
资源大小:99958k
文件大小:1k
源码类别:
Java编程
开发平台:
Java
- package filter5;
- import javax.servlet.*;
- import javax.servlet.http.*;
- import java.io.*;
- import java.util.*;
- public class Servlet1 extends HttpServlet {
- private static final String CONTENT_TYPE = "text/html; charset=GB2312";
- //Initialize global variables
- public void init() throws ServletException {
- }
- //Process the HTTP Get request
- public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
- response.setContentType(CONTENT_TYPE);
- PrintWriter out = response.getWriter();
- out.println("<html>");
- out.println("<head><title>Servlet1</title></head>");
- out.println("<body bgcolor="#ffffff">");
- out.println("<p>您已成功通过验证. 这是响应结果.</p>");
- out.println("</body></html>");
- System.out.println("succees!!");
- }
- //Clean up resources
- public void destroy() {
- }
- }