|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectshared.HelperBaseCh4
shared.HelperBaseCh5
shared.HelperBaseCh6
ch7.cookie.ControllerHelper
public class ControllerHelper
Read, write, delete and find cookies.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class shared.HelperBaseCh4 |
|---|
HelperBaseCh4.SessionData |
| Field Summary |
|---|
| Fields inherited from class shared.HelperBaseCh6 |
|---|
checked, selected |
| 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 | |
|---|---|
void |
copyFromSession(java.lang.Object sessionHelper)
Noting to do, but it still needs to be defined, since the super class is abstract and this is the abstract method. |
java.lang.String |
deleteMethod()
The method to call when the deleteCookie button is clicked. |
protected void |
doGet()
There is no bean for this application, only cookies. |
java.lang.String |
findMethod()
The method to call when the findCookie button is clicked. |
protected java.lang.String |
jspLocation(java.lang.String page)
Encapsulates the location of the JSPs. |
java.lang.String |
setMethod()
The method to call when the setCookie button is clicked. |
java.lang.String |
setSpecificMethod()
The method to call when the processCart button is clicked. |
java.lang.String |
showMethod()
The method to call when the showCookie button is clicked. |
| Methods inherited from class shared.HelperBaseCh6 |
|---|
addChecked, addChoice, addSelected, clearMaps, clearProperty, getChecked, getSelected, invokeGetter, setCheckedAndSelected, setCheckedAndSelected |
| Methods inherited from class shared.HelperBaseCh5 |
|---|
getErrors, isValid, isValidProperty, setErrors |
| 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 void copyFromSession(java.lang.Object sessionHelper)
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 showMethod()
Forward to the ShowCookies page.
The method is adorned with a ButtonMethod annotation that associates the name of a button with the method.
public java.lang.String setMethod()
Create two cookies and add them to the response. The cookies can be retrieved from any path on the server. One of the cookies will last until the browser closes, the other will expire in 15 seconds.
The method is adorned with a ButtonMethod annotation that associates the name of a button with the method.
public java.lang.String deleteMethod()
Delete the cookie by creating an identical cookie and setting its age to zero. The path must match the path of the existing cookie.
The method is adorned with a ButtonMethod annotation that associates the name of a button with the method.
public java.lang.String findMethod()
Retrieve all the cookies from the request and loop through them, looking for a cookie that has the matching name. Set a request attribute based on whether the cookie was found.
The method is adorned with a ButtonMethod annotation that associates the name of a button with the method.
public java.lang.String setSpecificMethod()
Loops through all the items in the cart and calculates the total number of items and the total price.
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 | |||||||||