|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectshared.HelperBaseCh4
ch4.enhanced.ControllerHelper
public class ControllerHelper
Helper that implements new features.
The base class has been moved to the shared package, since it contains member variables that use the same class for all controllers. The base class contains the request, response and logger variables.
This controller reuses the bean from Chapter 3, since no changes have been made to the bean.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class shared.HelperBaseCh4 |
|---|
HelperBaseCh4.SessionData |
| Field Summary |
|---|
| Fields inherited from class shared.HelperBaseCh4 |
|---|
logger, 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 | |
|---|---|
java.lang.String |
confirmMethod()
The method to call when the confirm button is clicked. |
void |
copyFromSession(java.lang.Object sessionHelper)
The implementation of the abstract method from the helper base. |
protected void |
doGet()
The new template for the doGet method. |
java.lang.String |
editMethod()
The method to call when the edit button is clicked. |
java.lang.Object |
getData()
An accessor that allows the JSPs to retrieve the bean from the helper. |
protected java.lang.String |
jspLocation(java.lang.String page)
Encapsulates the location of the JSPs. |
java.lang.String |
processMethod()
The method to call when the process button is clicked. |
| Methods inherited from class shared.HelperBaseCh4 |
|---|
addHelperToSession, addHelperToSession, doPost, executeButtonMethod, executeButtonMethod, fillBeanFromRequest, invokeButtonMethod, writeError |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ControllerHelper(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
request - Request information encapsulated in a Java objectresponse - Response information encapsulated in a Java object| Method Detail |
|---|
public java.lang.Object getData()
public void copyFromSession(java.lang.Object sessionHelper)
The method copies data from the old helper that is still in the session to the current helper.
copyFromSession in class HelperBaseCh4sessionHelper - The old helper that is still in the session.protected java.lang.String jspLocation(java.lang.String page)
page - The file name of the JSP.
public java.lang.String editMethod()
The method does nothing else at this time than indicate the address of the page.
The method is adorned with a ButtonMethod annotation that associates the name of a button with the method.
public java.lang.String confirmMethod()
Use the fillBeanFromRequest method to automatically copy the request data into the bean.
The method is adorned with a ButtonMethod annotation that associates the name of a button with the method.
public java.lang.String processMethod()
The method does nothing else at this time than indicate the address of the page.
The method is adorned with a ButtonMethod annotation that associates the name of a button with the method.
protected void doGet()
throws javax.servlet.ServletException,
java.io.IOException
doGet in class HelperBaseCh4javax.servlet.ServletException
java.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||