ch7.accountRemove
Class ControllerHelper

java.lang.Object
  extended by shared.HelperBaseCh4
      extended by shared.HelperBaseCh5
          extended by shared.HelperBaseCh6
              extended by ch7.accountLogin.ControllerHelper
                  extended by ch7.accountRemove.ControllerHelper

public class ControllerHelper
extends ControllerHelper

The same as the Account Login application, with the addtion of a button that allows the user to delete a row from the database.


Nested Class Summary
 
Nested classes/interfaces inherited from class shared.HelperBaseCh4
HelperBaseCh4.SessionData
 
Field Summary
 
Fields inherited from class ch7.accountLogin.ControllerHelper
data
 
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)
          The only constructor for this class has parameters for the request and response objects.
 
Method Summary
 java.lang.String jspLocation(java.lang.String page)
          Generates the full path to a JSP.
 java.lang.String removeMethod()
          The method that preforms the actions associated with the remove button.
 
Methods inherited from class ch7.accountLogin.ControllerHelper
confirmMethod, copyFromSession, doGet, doPost, editMethod, getData, getMethod, initHibernate, loginMethod, newUserMethod, processMethod
 
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, executeButtonMethod, executeButtonMethod, fillBeanFromRequest, invokeButtonMethod, populateThrow, writeError
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ControllerHelper

public ControllerHelper(javax.servlet.http.HttpServletRequest request,
                        javax.servlet.http.HttpServletResponse response)
The only constructor for this class has parameters for the request and response objects. These objects will be stored in member variables.

Parameters:
request - The object that encapsulates the request information that is needed to communicate with the browser.
response - The object that encapsulates the response information that is needed to communicate with the browser.
Method Detail

jspLocation

public java.lang.String jspLocation(java.lang.String page)
Generates the full path to a JSP.

Overrides:
jspLocation in class ControllerHelper
Parameters:
page - The name of the JSP. This will be appended to the path of the directory that contains the JSPs. Using this method forces all the JSPs to be in the same directory.
Returns:
The string that represents the complete path to the JSP. This path must be relative to the directory where the servlet is mapped or must begin with a /, which represents the root of the web application.

removeMethod

public java.lang.String removeMethod()
The method that preforms the actions associated with the remove button. The HibernateHelper class has a method that will remove a bean from the database. After the data is removed, create a new, empty bean that is not associated with the database.

Returns:
The address of the JSP that will complete the request.