ch3.reorganised
Class ControllerHelper

java.lang.Object
  extended by ch3.reorganised.HelperBase
      extended by ch3.reorganised.ControllerHelper

public class ControllerHelper
extends HelperBase

A helper class that can use member variables.

The helper creates and fills a bean with valid data. The doGet method is similar to the doGet method from previous controllers.


Field Summary
protected  RequestDataDefault data
          The bean that will store the validated request data.
 
Fields inherited from class ch3.reorganised.HelperBase
request, response
 
Constructor Summary
ControllerHelper(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Call the base class constructor to store the request and response.
 
Method Summary
protected  void doGet()
          This method is similar to the doGet method from previous controllers.
 java.lang.Object getData()
          An accessor that allows the JSPs to retrieve the bean from the helper.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

data

protected RequestDataDefault data
The bean that will store the validated request data.

Constructor Detail

ControllerHelper

public ControllerHelper(javax.servlet.http.HttpServletRequest request,
                        javax.servlet.http.HttpServletResponse response)
Call the base class constructor to store the request and response.

Parameters:
request - Request information encapsulated in a Java object
response - Response information encapsulated in a Java object
Method Detail

getData

public java.lang.Object getData()
An accessor that allows the JSPs to retrieve the bean from the helper.

Returns:
The bean that contains the data from the request.

doGet

protected void doGet()
              throws javax.servlet.ServletException,
                     java.io.IOException
This method is similar to the doGet method from previous controllers. Instead of placing the bean into the session, the entire helper is placed into the session. The bean can be retrieved from the helper via the getData method.

Throws:
javax.servlet.ServletException
java.io.IOException