Order the Book

coreservlets
Class ShowMessage

java.lang.Object
  |
  +--javax.servlet.GenericServlet
        |
        +--javax.servlet.http.HttpServlet
              |
              +--coreservlets.ShowMessage

public class ShowMessage
extends HttpServlet

Example using servlet initialization. Here, the message to print and the number of times the message should be repeated is taken from the init parameters.

Taken from Core Servlets and JavaServer Pages from Prentice Hall and Sun Microsystems Press, http://www.coreservlets.com/. © 2000 Marty Hall; may be freely used or adapted.

See Also:
Serialized Form

Constructor Summary
ShowMessage()
           
 
Method Summary
 void doGet(HttpServletRequest request, HttpServletResponse response)
           
 void init(ServletConfig config)
           
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doOptions, doPost, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ShowMessage

public ShowMessage()
Method Detail

init

public void init(ServletConfig config)
          throws ServletException
Overrides:
init in class GenericServlet

doGet

public void doGet(HttpServletRequest request,
                  HttpServletResponse response)
           throws ServletException,
                  IOException
Overrides:
doGet in class HttpServlet

Order the Book

Order
CSAJSP @ amazon.com

Return to Top-Level Source Code Archive