JAVAEE编程技术最好的源代码和课件下载。。。。。。。。

源代码在线查看: first.java

软件大小: 4494 K
上传用户: futianxiang0419
关键词: JAVAEE 编程技术 源代码
下载地址: 免注册下载 普通下载 VIP

相关代码

				/*
				 * First.java
				 *
				 * Created on 2007年10月15日, 上午9:39
				 */
				
				package com.servlet;
				
				import java.io.*;
				import java.net.*;
				
				import javax.servlet.*;
				import javax.servlet.http.*;
				
				/**
				 *
				 * @author hyl
				 * @version
				 */
				public class First extends HttpServlet {
				    
				    /** Processes requests for both HTTP GET and POST methods.
				     * @param request servlet request
				     * @param response servlet response
				     */
				    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
				    throws ServletException, IOException {
				        response.setContentType("text/html;charset=UTF-8");
				        PrintWriter out = response.getWriter();
				        out.println("");
				        out.println("");
				        out.println("Servlet First");
				        out.println("");
				        out.println("");
				        out.println("Hello World");
				        out.println("");
				        out.println("");
				         
				        out.close();
				    }
				    
				    // 
				    /** Handles the HTTP GET method.
				     * @param request servlet request
				     * @param response servlet response
				     */
				    protected void doGet(HttpServletRequest request, HttpServletResponse response)
				    throws ServletException, IOException {
				        processRequest(request, response);
				    }
				    
				    /** Handles the HTTP POST method.
				     * @param request servlet request
				     * @param response servlet response
				     */
				    protected void doPost(HttpServletRequest request, HttpServletResponse response)
				    throws ServletException, IOException {
				        processRequest(request, response);
				    }
				    
				    /** Returns a short description of the servlet.
				     */
				    public String getServletInfo() {
				        return "Short description";
				    }
				    // 
				}
							

相关资源