Arch4J 1.1

org.arch4j.webpresentation
Class FrontCommand

java.lang.Object
  |
  +--org.arch4j.webpresentation.FrontCommand
Direct Known Subclasses:
ExceptionFrontCommand, UnknownFrontCommand

public abstract class FrontCommand
extends Object

This class is the root of a hierarchy of classes that implement the Commmand pattern to handle an HTTP request.

Version:
$Revision: 1.1 $
Author:
$Author: rgreinke $

Field Summary
protected  javax.servlet.ServletContext context
           
protected  javax.servlet.http.HttpServletRequest request
           
protected  javax.servlet.http.HttpServletResponse response
           
 
Constructor Summary
FrontCommand()
           
 
Method Summary
abstract  String execute()
          Execute the command and return the target to forward to.
 void init(javax.servlet.ServletContext context, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Initialize the command object with information from a servlet.
 void setHelperAttribute(Object helper)
          Put the given helper object into the request.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

context

protected javax.servlet.ServletContext context

request

protected javax.servlet.http.HttpServletRequest request

response

protected javax.servlet.http.HttpServletResponse response
Constructor Detail

FrontCommand

public FrontCommand()
Method Detail

init

public void init(javax.servlet.ServletContext context,
                 javax.servlet.http.HttpServletRequest request,
                 javax.servlet.http.HttpServletResponse response)
Initialize the command object with information from a servlet. These variables are stored and are available for subclasses to use.

Parameters:
context - A ServletContext object that contains the context for the application.
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.

execute

public abstract String execute()
                        throws javax.servlet.ServletException,
                               IOException
Execute the command and return the target to forward to.

Returns:
A String containing a fully-qualified resource name, which will be forwarded to.
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.

setHelperAttribute

public void setHelperAttribute(Object helper)
Put the given helper object into the request. The attribute name is given by the constant FrontConstants.HELPER_ATTRIBUTE_NAME.

Parameters:
helper - The helper object to put into the request.

Arch4J 1.1

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