⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 generichello.java

📁 java2 primer plus一书源程序
💻 JAVA
字号:
/*
 * GenericHello.java
 *
 * Created on June 21, 2002, 5:28 PM
 */


import javax.servlet.*;
import java.io.*;

/**
 *
 * @author  Stephen Potts
 * @version
 */
public class GenericHello extends GenericServlet
{
    
    /** Initializes the servlet.
     */
    public void init(ServletConfig config) throws ServletException
    {
        super.init(config);
        
    }
    
    /** Destroys the servlet.
     */
    public void destroy()
    {
        
    }
    
    public void service(ServletRequest req, ServletResponse resp)
    throws ServletException, java.io.IOException
    {
        resp.setContentType("text/html");
        java.io.PrintWriter out = resp.getWriter();
        out.println("Hello from the GenericHello Servlet");
        out.close();
    }
    
    /** Returns a short description of the servlet.
     */
    public String getServletInfo()
    {
        return "This servlet tests the GenericServlet class";
    }
    
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -