gov.noaa.pmel.tmap
Class AbstractFormBean

java.lang.Object
  |
  +--gov.noaa.pmel.tmap.AbstractFormBean
All Implemented Interfaces:
FormBean
Direct Known Subclasses:
ConstrainFormBean, DatasetFormBean, OptionsFormBean, SearchFormBean

public abstract class AbstractFormBean
extends java.lang.Object
implements FormBean


Field Summary
(package private)  java.lang.String mErrorMessage
           
(package private)  FormParameters mParams
           
(package private)  HttpServletRequest mReq
           
(package private)  TemplateSession mSession
           
 
Constructor Summary
AbstractFormBean()
           
 
Method Summary
 java.lang.String getErrorMessage()
          Error message to display if form is not valid.
 FormHandler getFormHandler()
           
 FormParameters getParameters()
          Form parameters contained in the HTTP post
 HttpServletRequest getRequest()
           
 TemplateSession getSession()
           
abstract  void handle()
          Handle the form.
 void init(HttpServletRequest req)
          Initializes the FormBean
abstract  boolean isValid(java.lang.String nextUrl)
          Validate form parameters
abstract  java.lang.String nextURL()
          next URL to use after the form has been processed
 void setErrorMessage(java.lang.String mess)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mErrorMessage

java.lang.String mErrorMessage

mParams

FormParameters mParams

mReq

HttpServletRequest mReq

mSession

TemplateSession mSession
Constructor Detail

AbstractFormBean

public AbstractFormBean()
Method Detail

init

public void init(HttpServletRequest req)
          throws ServletException,
                 java.sql.SQLException
Description copied from interface: FormBean
Initializes the FormBean

Specified by:
init in interface FormBean
Parameters:
req - the servlet requrest
ServletException
java.sql.SQLException

isValid

public abstract boolean isValid(java.lang.String nextUrl)
                         throws ServletException,
                                java.sql.SQLException
Description copied from interface: FormBean
Validate form parameters

Specified by:
isValid in interface FormBean
Parameters:
nextUrl - nextUrl to visit after form has been processed
Returns:
true if form parameters valid
ServletException
java.sql.SQLException

setErrorMessage

public void setErrorMessage(java.lang.String mess)

getErrorMessage

public java.lang.String getErrorMessage()
                                 throws ServletException,
                                        java.sql.SQLException
Description copied from interface: FormBean
Error message to display if form is not valid.

Specified by:
getErrorMessage in interface FormBean
Returns:
error message
ServletException
java.sql.SQLException

handle

public abstract void handle()
                     throws ServletException,
                            java.sql.SQLException
Description copied from interface: FormBean
Handle the form. Logic for storing any state, etc. should go here

Specified by:
handle in interface FormBean
ServletException
java.sql.SQLException

nextURL

public abstract java.lang.String nextURL()
                                  throws ServletException,
                                         java.sql.SQLException
Description copied from interface: FormBean
next URL to use after the form has been processed

Specified by:
nextURL in interface FormBean
Returns:
next URL to use after the form has been processed
ServletException
java.sql.SQLException

getParameters

public FormParameters getParameters()
Description copied from interface: FormBean
Form parameters contained in the HTTP post

Specified by:
getParameters in interface FormBean
Returns:
form parameters contained in the HTTP post

getFormHandler

public FormHandler getFormHandler()

getRequest

public HttpServletRequest getRequest()

getSession

public TemplateSession getSession()