Arch4J 1.1

org.arch4j.webpresentation
Class FrontControllerServlet

java.lang.Object
  |
  +--javax.servlet.GenericServlet
        |
        +--javax.servlet.http.HttpServlet
              |
              +--org.arch4j.webpresentation.FrontControllerServlet
All Implemented Interfaces:
Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig
Direct Known Subclasses:
CommandDrivenFrontController

public abstract class FrontControllerServlet
extends javax.servlet.http.HttpServlet

This class is the root of a hierarchy of servlet-based classes that can be used as a front-end handler of requests to a web site.

Version:
$Revision: 1.1 $
Author:
$Author: rgreinke $
See Also:
Serialized Form

Constructor Summary
FrontControllerServlet()
           
 
Method Summary
protected  void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Called by the server (via the service method) to allow a servlet to handle a GET request.
protected  void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Called by the server (via the service method) to allow a servlet to handle a POST request.
protected  void forward(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String target)
          Forwards the request to another resource (servlet, JSP file, or HTML file) on the server.
protected abstract  void handleRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Handles requests for both HTTP GET and POST methods.
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FrontControllerServlet

public FrontControllerServlet()
Method Detail

doGet

protected void doGet(javax.servlet.http.HttpServletRequest request,
                     javax.servlet.http.HttpServletResponse response)
              throws javax.servlet.ServletException,
                     IOException
Called by the server (via the service method) to allow a servlet to handle a GET request.

Overrides:
doGet in class javax.servlet.http.HttpServlet
Parameters:
request - an HttpServletRequest object that contains the request the client has made of the servlet
response - an HttpServletResponse object that contains the response the servlet sends to the client
Throws:
IOException - if an input or output error is detected when the servlet handles the GET request
javax.servlet.ServletException - if the request for the GET could not be handled

doPost

protected void doPost(javax.servlet.http.HttpServletRequest request,
                      javax.servlet.http.HttpServletResponse response)
               throws javax.servlet.ServletException,
                      IOException
Called by the server (via the service method) to allow a servlet to handle a POST request.

Overrides:
doPost in class javax.servlet.http.HttpServlet
Parameters:
request - an HttpServletRequest object that contains the request the client has made of the servlet
response - an HttpServletResponse object that contains the response the servlet sends to the client
Throws:
IOException - if an input or output error is detected when the servlet handles the request
javax.servlet.ServletException - if the request for the POST could not be handled

handleRequest

protected abstract void handleRequest(javax.servlet.http.HttpServletRequest request,
                                      javax.servlet.http.HttpServletResponse response)
                               throws javax.servlet.ServletException,
                                      IOException
Handles requests for both HTTP GET and POST methods. This method should be overridden and implemented in subclasses.

Parameters:
request - An HttpServletRequest object that contains the request the client has made of the servlet.
response - An HttpServletResponse object that contains the response the servlet sends to the client.
Throws:
javax.servlet.ServletException - If the request could not be handled.
IOException - If an input or output error is detected when the servlet handles the request.

forward

protected void forward(javax.servlet.http.HttpServletRequest request,
                       javax.servlet.http.HttpServletResponse response,
                       String target)
                throws javax.servlet.ServletException,
                       IOException
Forwards the request to another resource (servlet, JSP file, or HTML file) on the server.

Parameters:
request - An HttpServletRequest object that contains the request the client has made of the servlet.
response - An HttpServletResponse object that contains the response the servlet sends to the client.
target - A String specifying the pathname to the resource.
Throws:
javax.servlet.ServletException - If the target resource throws this exception.
IOException - If the target resource throws this exception.

Arch4J 1.1

Copyright © 2000-2004 SpiderLogic, a service of Wipfli Ullrich Bertelson LLP.