gov.noaa.pmel.tmap
Interface FormBean

All Known Implementing Classes:
AbstractFormBean

public interface FormBean

Handles forms submitted to the LAS servlet. Only forms that are submitted via a HTTP POST will be handled. A servlet filter automatically routes the POST request to a class that implements this interface.

The class that implements this interface has to be named <template>FromBean where <template> is the name of the Velocity template containing HTML that describes the form

Version:
$Revision: 1.2 $
Author:
$Author: kobrien $
See Also:
FormFilter

Method Summary
 java.lang.String getErrorMessage()
          Error message to display if form is not valid.
 FormParameters getParameters()
          Form parameters contained in the HTTP post
 void handle()
          Handle the form.
 void init(HttpServletRequest req)
          Initializes the FormBean
 boolean isValid(java.lang.String nextUrl)
          Validate form parameters
 java.lang.String nextURL()
          next URL to use after the form has been processed
 

Method Detail

init

public void init(HttpServletRequest req)
          throws ServletException,
                 java.sql.SQLException
Initializes the FormBean

Parameters:
req - the servlet requrest
ServletException
java.sql.SQLException

isValid

public boolean isValid(java.lang.String nextUrl)
                throws ServletException,
                       java.sql.SQLException
Validate form parameters

Parameters:
nextUrl - nextUrl to visit after form has been processed
Returns:
true if form parameters valid
ServletException
java.sql.SQLException

getErrorMessage

public java.lang.String getErrorMessage()
                                 throws ServletException,
                                        java.sql.SQLException
Error message to display if form is not valid.

Returns:
error message
ServletException
java.sql.SQLException

handle

public void handle()
            throws ServletException,
                   java.sql.SQLException
Handle the form. Logic for storing any state, etc. should go here

ServletException
java.sql.SQLException

nextURL

public java.lang.String nextURL()
                         throws ServletException,
                                java.sql.SQLException
next URL to use after the form has been processed

Returns:
next URL to use after the form has been processed
ServletException
java.sql.SQLException

getParameters

public FormParameters getParameters()
Form parameters contained in the HTTP post

Returns:
form parameters contained in the HTTP post