net.sf.springlayout.web.controller
Class AbstractBaseFormController

java.lang.Object
  extended by org.springframework.context.support.ApplicationObjectSupport
      extended by org.springframework.web.context.support.WebApplicationObjectSupport
          extended by org.springframework.web.servlet.support.WebContentGenerator
              extended by org.springframework.web.servlet.mvc.AbstractController
                  extended by org.springframework.web.servlet.mvc.BaseCommandController
                      extended by org.springframework.web.servlet.mvc.AbstractFormController
                          extended by org.springframework.web.servlet.mvc.SimpleFormController
                              extended by net.sf.springlayout.web.controller.AbstractBaseFormController
All Implemented Interfaces:
FormController, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware, org.springframework.web.servlet.mvc.Controller
Direct Known Subclasses:
AbstractPanelFormController

public abstract class AbstractBaseFormController
extends org.springframework.web.servlet.mvc.SimpleFormController
implements org.springframework.beans.factory.InitializingBean, FormController

Base form controller class for all controllers. Provides delegation to a method in the controller based on the value of the "method" field / parameter in the request.

Overrides the referenceData() method and delegates to setupReadModeReferenceData() if the request is considered to be in read mode or setupEditModeReferenceData() if the request is in edit mode.

Also provides helper methods for getting localised messages and saving messages to the session. Messages saved to the session should be used in conjunction with an appropriate cleanup strategy such as the UserResolvingInterceptor.

Author:
Rob Monie, Adam Boas
See Also:
MessagesInterceptor

Field Summary
protected static org.apache.commons.logging.Log log
           
protected static java.lang.String PERSIST_VAL_THROUGH_REDIRECT
           
 
Fields inherited from class org.springframework.web.servlet.mvc.BaseCommandController
DEFAULT_COMMAND_NAME
 
Fields inherited from class org.springframework.web.servlet.support.WebContentGenerator
HEADER_CACHE_CONTROL, HEADER_EXPIRES, HEADER_PRAGMA, METHOD_GET, METHOD_HEAD, METHOD_POST
 
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
 
Constructor Summary
AbstractBaseFormController()
           
 
Method Summary
 void afterPropertiesSet()
           
protected  org.springframework.web.bind.ServletRequestDataBinder createBinder(javax.servlet.http.HttpServletRequest request, java.lang.Object command)
          Overridden to allow registering of default property editor with default to allow null.
 java.util.Map defineReadOnlyFields(javax.servlet.http.HttpServletRequest request)
          Override to define a map of field paths that are to be treated as readOnly when the page is in edit mode.
protected  void editCommandBeforeBind(javax.servlet.http.HttpServletRequest request, java.lang.Object command)
          A method which allow modify the command object before do the binding.
 java.lang.Object getCommandObject(javax.servlet.http.HttpServletRequest request)
          Allows external multi-panel validators to get the command associated with this controller.
 java.lang.String getDefaultEditMode()
          Gets the default edit mode
protected  int[] getGridRemoveIndexes(javax.servlet.http.HttpServletRequest request, java.lang.String gridId)
          A convenience method to provide an Array of indexes which the User has requested to be removed from the collection contained in the DataGrid identified by the gridId provided.
protected  java.lang.String getMessage(java.lang.String code, javax.servlet.http.HttpServletRequest request)
          Gets a message from the resource bundle based on the current locale and key passed.
protected  java.lang.String getMessage(java.lang.String code, java.lang.Object[] args, javax.servlet.http.HttpServletRequest request)
          Gets a message from the resource bundle based on the current locale and key / arguments passed.
protected  int getNewGridSize(javax.servlet.http.HttpServletRequest request, java.lang.String gridId)
          A convenience method to return the size of the list for the DataGrid identified by the gridId provided.
 PageAccessResolver getPageAccessResolver()
          Getes the pageAccessResolver for this request
 java.lang.String getRedirectFormView()
           
protected  java.util.Map getStateMap(javax.servlet.http.HttpServletRequest request)
          Retrieves the request parameter map in it's current updated state.
protected  java.util.Map getStateMapForUrl(javax.servlet.http.HttpServletRequest request)
          Gets the state map with parameters only to be included in the url.
protected  org.springframework.web.servlet.ModelAndView handleRequestInternal(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           Adds a PageAccessHolder to the request using the WebConstants.PAGE_ACCESS_HOLDER attribute with default settings based on the WebConstants.EDIT_MODE_PARAM passed with the request.
 void initBinder(javax.servlet.http.HttpServletRequest request, org.springframework.web.bind.ServletRequestDataBinder binder)
           
 boolean isCommandDirty(javax.servlet.http.HttpServletRequest request)
           
protected  boolean isDefaultPropertyEditorsAllowEmpty()
          Has this controller been set to allow nulls in property editors.
protected  boolean isPersistValidateModeThroughGetRedirect(javax.servlet.http.HttpServletRequest request)
          Checks if the validatemode has been set to survive a redirect triggered by a get.
protected  void manageDataGrid(javax.servlet.http.HttpServletRequest request)
          Manages datagrid.
protected  void onBind(javax.servlet.http.HttpServletRequest request, java.lang.Object command, org.springframework.validation.BindException errors)
          Calls the method specified in the "method" parameter of the request if one is available with a signature of: (Httprequest request, Object command) Whether this method is invoked or not it then calls onBindAfterPreValidationMethod.
protected  void onBindAfterPreValidationMethod(javax.servlet.http.HttpServletRequest request, java.lang.Object command, org.springframework.validation.BindException errors)
          Should be implemented by subclasses that wish to perform an action before validation takes place.
protected  void onBindAndValidate(javax.servlet.http.HttpServletRequest request, java.lang.Object command, org.springframework.validation.BindException errors)
          Calls through to the Form validate method..
protected  org.springframework.web.servlet.ModelAndView onSubmit(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.Object command, org.springframework.validation.BindException errors)
          Calls the method specified in the "method" parameter of the request.
protected  org.springframework.web.servlet.ModelAndView processFormSubmission(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.Object command, org.springframework.validation.BindException errors)
           
protected  java.util.Map referenceData(javax.servlet.http.HttpServletRequest request, java.lang.Object command, org.springframework.validation.Errors errors)
          Default implementation here first checks to see the mode and defers to setupReadModeReferenceData or setupEditModeReferenceData depending on the current mode.
 org.springframework.web.servlet.ModelAndView refresh(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.Object command, org.springframework.validation.BindException errors)
          Refreshes the current page after binding fields to the model.
protected  void registerDefaultPropertyEditors(javax.servlet.http.HttpServletRequest request, org.springframework.web.bind.ServletRequestDataBinder binder)
          register default property editors with allow empty
protected  void saveMessages(Messages messages, javax.servlet.http.HttpServletRequest request)
          Save the messages to the session
 void setCommandClean(javax.servlet.http.HttpServletRequest request)
           
 void setCommandDirty(javax.servlet.http.HttpServletRequest request)
           
 void setDefaultEditMode(java.lang.String defaultEditMode)
          Sets the default edit mode - "1" or "true" for editMode, "0" or "false" for read mode.
 void setDefaultPropertyEditorsAllowEmpty(boolean defaultPropertyEditorsAllowEmpty)
          Set the controller to override the default Spring behaviour of registering property editors with allow empty as false to allowEmpty=true If this property is set to true, all default property editors are registered to allow null values.
protected  void setEditMode(javax.servlet.http.HttpServletRequest request, boolean editMode)
          Sets the edit mode for the current request.
 void setForm(Form form)
          The form for this controller
 void setPageAccessResolver(PageAccessResolver pageAccessResolver)
          Sets the pageAccessResolver for the controller
protected  void setPersistValidateModeThroughGetRedirect(javax.servlet.http.HttpServletRequest request)
          Sets whether the current validation mode state should survive a redirect caused by a get.
 void setRedirectFormView(java.lang.String redirectView)
           
protected  void setStateMapField(javax.servlet.http.HttpServletRequest request, java.lang.String name, java.lang.String value)
          Sets the parameter name/value pair in the current state map.
protected  java.util.Map setupEditModeReferenceData(javax.servlet.http.HttpServletRequest request, java.lang.Object command, org.springframework.validation.Errors errors)
           Create a reference data map in EDIT MODE for the given request and command, consisting of bean name/bean instance pairs as expected by ModelAndView.
protected  java.util.Map setupReadModeReferenceData(javax.servlet.http.HttpServletRequest request, java.lang.Object command, org.springframework.validation.Errors errors)
           Create a reference data map in READ MODE for the given request and command, consisting of bean name/bean instance pairs as expected by ModelAndView.
protected  org.springframework.web.servlet.ModelAndView showForm(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.springframework.validation.BindException errors)
          Calls the controller pageAccessResolver if it exists and then super.showForm
 
Methods inherited from class org.springframework.web.servlet.mvc.SimpleFormController
doSubmitAction, getFormView, getSuccessView, isFormChangeRequest, onFormChange, onFormChange, onSubmit, onSubmit, referenceData, setFormView, setSuccessView, showForm, suppressValidation
 
Methods inherited from class org.springframework.web.servlet.mvc.AbstractFormController
currentFormObject, formBackingObject, getCommand, getErrorsForNewForm, getFormSessionAttributeName, getFormSessionAttributeName, handleInvalidSubmit, isBindOnNewForm, isFormSubmission, isSessionForm, onBindOnNewForm, onBindOnNewForm, setBindOnNewForm, setSessionForm, showForm, showForm, showNewForm
 
Methods inherited from class org.springframework.web.servlet.mvc.BaseCommandController
bindAndValidate, checkCommand, createCommand, getBindingErrorProcessor, getCommandClass, getCommandName, getMessageCodesResolver, getPropertyEditorRegistrars, getValidator, getValidators, initApplicationContext, isValidateOnBinding, onBind, setBindingErrorProcessor, setCommandClass, setCommandName, setMessageCodesResolver, setPropertyEditorRegistrar, setPropertyEditorRegistrars, setValidateOnBinding, setValidator, setValidators, suppressBinding
 
Methods inherited from class org.springframework.web.servlet.mvc.AbstractController
handleRequest, isSynchronizeOnSession, setSynchronizeOnSession
 
Methods inherited from class org.springframework.web.servlet.support.WebContentGenerator
applyCacheSeconds, applyCacheSeconds, cacheForSeconds, cacheForSeconds, checkAndPrepare, checkAndPrepare, getCacheSeconds, getSupportedMethods, isRequireSession, isUseCacheControlHeader, isUseExpiresHeader, preventCaching, setCacheSeconds, setRequireSession, setSupportedMethods, setUseCacheControlHeader, setUseExpiresHeader
 
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, isContextRequired
 
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, requiredContextClass, setApplicationContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sf.springlayout.web.controller.FormController
getCommandName
 

Field Detail

log

protected static org.apache.commons.logging.Log log

PERSIST_VAL_THROUGH_REDIRECT

protected static java.lang.String PERSIST_VAL_THROUGH_REDIRECT
Constructor Detail

AbstractBaseFormController

public AbstractBaseFormController()
Method Detail

isDefaultPropertyEditorsAllowEmpty

protected boolean isDefaultPropertyEditorsAllowEmpty()
Has this controller been set to allow nulls in property editors. By default the basic property editors registered for binding by Spring will throw binding errors if a null value is encountered. If this property is set to true, all default property editors are registered to allow null.

Returns:

setPageAccessResolver

public void setPageAccessResolver(PageAccessResolver pageAccessResolver)
Sets the pageAccessResolver for the controller

Parameters:
pageAccessResolver -

getPageAccessResolver

public PageAccessResolver getPageAccessResolver()
Getes the pageAccessResolver for this request

Returns:

setDefaultPropertyEditorsAllowEmpty

public void setDefaultPropertyEditorsAllowEmpty(boolean defaultPropertyEditorsAllowEmpty)
Set the controller to override the default Spring behaviour of registering property editors with allow empty as false to allowEmpty=true If this property is set to true, all default property editors are registered to allow null values. default if not set is 'false' to maintain consistency with default Spring behaviour.

Parameters:
defaultPropertyEditorsAllowEmpty -

setForm

public void setForm(Form form)
The form for this controller

Parameters:
form -

setDefaultEditMode

public void setDefaultEditMode(java.lang.String defaultEditMode)
Sets the default edit mode - "1" or "true" for editMode, "0" or "false" for read mode. Default if not set is false

Parameters:
defaultEditMode - The defaultEditMode to set.

initBinder

public void initBinder(javax.servlet.http.HttpServletRequest request,
                       org.springframework.web.bind.ServletRequestDataBinder binder)
                throws java.lang.Exception
Specified by:
initBinder in interface FormController
Overrides:
initBinder in class org.springframework.web.servlet.mvc.BaseCommandController
Throws:
java.lang.Exception

getCommandObject

public java.lang.Object getCommandObject(javax.servlet.http.HttpServletRequest request)
Allows external multi-panel validators to get the command associated with this controller.

Specified by:
getCommandObject in interface FormController
Parameters:
request -
Returns:
the command object which this controller is using.
Throws:
java.lang.Exception

getDefaultEditMode

public java.lang.String getDefaultEditMode()
Gets the default edit mode

Returns:

onBind

protected final void onBind(javax.servlet.http.HttpServletRequest request,
                            java.lang.Object command,
                            org.springframework.validation.BindException errors)
                     throws java.lang.Exception
Calls the method specified in the "method" parameter of the request if one is available with a signature of: (Httprequest request, Object command) Whether this method is invoked or not it then calls onBindAfterPreValidationMethod. Please note that any code which would have been placed in the onBind method under the normal Spring framework must now be placed in onBindAfterPreValidationMethod.

Overrides:
onBind in class org.springframework.web.servlet.mvc.BaseCommandController
Throws:
java.lang.Exception

onBindAfterPreValidationMethod

protected void onBindAfterPreValidationMethod(javax.servlet.http.HttpServletRequest request,
                                              java.lang.Object command,
                                              org.springframework.validation.BindException errors)
                                       throws java.lang.Exception
Should be implemented by subclasses that wish to perform an action before validation takes place.

Parameters:
request -
command -
Throws:
java.lang.Exception
See Also:
BaseCommandController.onBind(javax.servlet.http.HttpServletRequest, java.lang.Object)

onSubmit

protected org.springframework.web.servlet.ModelAndView onSubmit(javax.servlet.http.HttpServletRequest request,
                                                                javax.servlet.http.HttpServletResponse response,
                                                                java.lang.Object command,
                                                                org.springframework.validation.BindException errors)
                                                         throws java.lang.Exception
Calls the method specified in the "method" parameter of the request. Enables process specific methods to be defined in the controller such as save(), delete(), approve(), reject().

Overrides:
onSubmit in class org.springframework.web.servlet.mvc.SimpleFormController
Throws:
java.lang.Exception
See Also:
SimpleFormController.onSubmit(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.Object, org.springframework.validation.BindException)

onBindAndValidate

protected void onBindAndValidate(javax.servlet.http.HttpServletRequest request,
                                 java.lang.Object command,
                                 org.springframework.validation.BindException errors)
                          throws java.lang.Exception
Calls through to the Form validate method.. Subclasses that override this method should call super if requestAwareValidator or PanelFormGroup validation is to be automatically invoked.

Overrides:
onBindAndValidate in class org.springframework.web.servlet.mvc.BaseCommandController
Throws:
java.lang.Exception
See Also:
BaseCommandController.onBindAndValidate(javax.servlet.http.HttpServletRequest, java.lang.Object, org.springframework.validation.BindException)

referenceData

protected java.util.Map referenceData(javax.servlet.http.HttpServletRequest request,
                                      java.lang.Object command,
                                      org.springframework.validation.Errors errors)
                               throws java.lang.Exception
Default implementation here first checks to see the mode and defers to setupReadModeReferenceData or setupEditModeReferenceData depending on the current mode.

Override either of these methods to get referencedata setup at the appropriate time. If more control is required, override this method directly and defer to setupReadModeReferenceData or setupEditModeReferenceData when appropriate.

Overrides:
referenceData in class org.springframework.web.servlet.mvc.SimpleFormController
Throws:
java.lang.Exception
See Also:
SimpleFormController.referenceData(javax.servlet.http.HttpServletRequest, java.lang.Object, org.springframework.validation.Errors)

setupEditModeReferenceData

protected java.util.Map setupEditModeReferenceData(javax.servlet.http.HttpServletRequest request,
                                                   java.lang.Object command,
                                                   org.springframework.validation.Errors errors)
                                            throws java.lang.Exception

Create a reference data map in EDIT MODE for the given request and command, consisting of bean name/bean instance pairs as expected by ModelAndView.

Subclasses can override this to setup reference data used in the view. Override this method instead of the standard referenceData() method to get conditional execution based on the page read / edit state for free.

NOTE: This method will be called in EDIT mode only

Parameters:
request - current HTTP request
command - form object with request parameters bound onto it
errors - validation errors holder
Returns:
a Map with reference data entries, or null if none
Throws:
java.lang.Exception - in case of invalid state or arguments
See Also:
SimpleFormController.referenceData(javax.servlet.http.HttpServletRequest, java.lang.Object, org.springframework.validation.Errors)

setupReadModeReferenceData

protected java.util.Map setupReadModeReferenceData(javax.servlet.http.HttpServletRequest request,
                                                   java.lang.Object command,
                                                   org.springframework.validation.Errors errors)
                                            throws java.lang.Exception

Create a reference data map in READ MODE for the given request and command, consisting of bean name/bean instance pairs as expected by ModelAndView.

Subclasses can override this to setup reference data used in the view. Override this method instead of the standard referenceData() method to get conditional execution based on the page read / edit state for free.

NOTE: This method will be called in READ mode only

Parameters:
request - current HTTP request
command - form object with request parameters bound onto it
errors - validation errors holder
Returns:
a Map with reference data entries, or null if none
Throws:
java.lang.Exception - in case of invalid state or arguments
See Also:
SimpleFormController.referenceData(javax.servlet.http.HttpServletRequest, java.lang.Object, org.springframework.validation.Errors)

handleRequestInternal

protected org.springframework.web.servlet.ModelAndView handleRequestInternal(javax.servlet.http.HttpServletRequest request,
                                                                             javax.servlet.http.HttpServletResponse response)
                                                                      throws java.lang.Exception

Adds a PageAccessHolder to the request using the WebConstants.PAGE_ACCESS_HOLDER attribute with default settings based on the WebConstants.EDIT_MODE_PARAM passed with the request. Calls through to super to return to the regular controller lifecycle. On GET's calls the PageAccessResolver for the controller if present.

Note: If the WebConstants.PAGE_ACCESS_HOLDER attribute is set at a lower level controller such as the AbstractListFormController, the existing pageAccessHolder will remain untouched and the WebConstants.EDIT_MODE_PARAM will be ignored.

Overrides:
handleRequestInternal in class org.springframework.web.servlet.mvc.AbstractFormController
Throws:
java.lang.Exception
See Also:
AbstractController.handleRequestInternal(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)

manageDataGrid

protected void manageDataGrid(javax.servlet.http.HttpServletRequest request)
Manages datagrid. Moves datagrid management fields into the request attributes for use after a forward generated by errors.

Parameters:
request -

editCommandBeforeBind

protected void editCommandBeforeBind(javax.servlet.http.HttpServletRequest request,
                                     java.lang.Object command)
                              throws java.lang.Exception
A method which allow modify the command object before do the binding.

Parameters:
request -
Throws:
java.lang.Exception

getGridRemoveIndexes

protected int[] getGridRemoveIndexes(javax.servlet.http.HttpServletRequest request,
                                     java.lang.String gridId)
                              throws org.springframework.web.bind.ServletRequestBindingException
A convenience method to provide an Array of indexes which the User has requested to be removed from the collection contained in the DataGrid identified by the gridId provided. This method is intended to be called from editCommandBeforeBind() to allow the Collection which the DataGrid is bound to to be modified before binding occurs.

Parameters:
request -
gridId - identifies the DataGrid which has 0 or more indexes to be removed.
Returns:
Array of indeses which the user has requested to be removed from the Collection in the DataGrid identified by the gridId provided.
Throws:
org.springframework.web.bind.ServletRequestBindingException

getNewGridSize

protected int getNewGridSize(javax.servlet.http.HttpServletRequest request,
                             java.lang.String gridId)
A convenience method to return the size of the list for the DataGrid identified by the gridId provided.

Parameters:
request -
gridId - the id of the DataGrid to check for a user request to add a row.
Returns:
the size of the list required for the grid to bind against or -1 if list size is unchanged.

isPersistValidateModeThroughGetRedirect

protected boolean isPersistValidateModeThroughGetRedirect(javax.servlet.http.HttpServletRequest request)
Checks if the validatemode has been set to survive a redirect triggered by a get.

Parameters:
request -
Returns:

setPersistValidateModeThroughGetRedirect

protected void setPersistValidateModeThroughGetRedirect(javax.servlet.http.HttpServletRequest request)
Sets whether the current validation mode state should survive a redirect caused by a get. This is useful if a condition is required on opening of a GET request that may redirect to another page and the validation mode is to be maintained.

Parameters:
request -

getMessage

protected java.lang.String getMessage(java.lang.String code,
                                      java.lang.Object[] args,
                                      javax.servlet.http.HttpServletRequest request)
                               throws org.springframework.context.NoSuchMessageException
Gets a message from the resource bundle based on the current locale and key / arguments passed.

Parameters:
code - the key to the message
args - arguments to be parsed with the message
request - current request
Returns:
a localised message
Throws:
org.springframework.context.NoSuchMessageException

getMessage

protected java.lang.String getMessage(java.lang.String code,
                                      javax.servlet.http.HttpServletRequest request)
                               throws org.springframework.context.NoSuchMessageException
Gets a message from the resource bundle based on the current locale and key passed.

Parameters:
code - the key to the message
request - current request
Returns:
a localised message
Throws:
org.springframework.context.NoSuchMessageException

saveMessages

protected void saveMessages(Messages messages,
                            javax.servlet.http.HttpServletRequest request)
Save the messages to the session

Parameters:
messages -
request -

setEditMode

protected void setEditMode(javax.servlet.http.HttpServletRequest request,
                           boolean editMode)
Sets the edit mode for the current request.

Parameters:
request -
editMode - to set the current request to: true - editMode, false - readmode.

defineReadOnlyFields

public java.util.Map defineReadOnlyFields(javax.servlet.http.HttpServletRequest request)
Override to define a map of field paths that are to be treated as readOnly when the page is in edit mode. This default implementation returns an empty fieldMap

Parameters:
request -
Returns:
map of fields for read only display

refresh

public org.springframework.web.servlet.ModelAndView refresh(javax.servlet.http.HttpServletRequest request,
                                                            javax.servlet.http.HttpServletResponse response,
                                                            java.lang.Object command,
                                                            org.springframework.validation.BindException errors)
                                                     throws java.lang.Exception
Refreshes the current page after binding fields to the model. Useful for generic refreshing of the UI after front end changes

Parameters:
request -
response -
command -
errors -
Returns:
Throws:
java.lang.Exception

createBinder

protected org.springframework.web.bind.ServletRequestDataBinder createBinder(javax.servlet.http.HttpServletRequest request,
                                                                             java.lang.Object command)
                                                                      throws java.lang.Exception
Overridden to allow registering of default property editor with default to allow null. All current spring behaviour has been maintained within this class. Class has been completely overridden in order to slot default property editor registering at the appropriate place

Overrides:
createBinder in class org.springframework.web.servlet.mvc.BaseCommandController
Parameters:
request - current HTTP request
command - the command to bind onto
Returns:
the new binder instance
Throws:
java.lang.Exception - in case of invalid state or arguments
See Also:
BaseCommandController.bindAndValidate(javax.servlet.http.HttpServletRequest, java.lang.Object), initBinder(javax.servlet.http.HttpServletRequest, org.springframework.web.bind.ServletRequestDataBinder), BaseCommandController.setMessageCodesResolver(org.springframework.validation.MessageCodesResolver), BaseCommandController.setBindingErrorProcessor(org.springframework.validation.BindingErrorProcessor)

registerDefaultPropertyEditors

protected void registerDefaultPropertyEditors(javax.servlet.http.HttpServletRequest request,
                                              org.springframework.web.bind.ServletRequestDataBinder binder)
register default property editors with allow empty

Parameters:
request -
binder -

getStateMap

protected java.util.Map getStateMap(javax.servlet.http.HttpServletRequest request)
Retrieves the request parameter map in it's current updated state. If opening a new record returns a new empty param map.

Parameters:
request -
Returns:
the request parameter map in it's current updated state.

setStateMapField

protected void setStateMapField(javax.servlet.http.HttpServletRequest request,
                                java.lang.String name,
                                java.lang.String value)
Sets the parameter name/value pair in the current state map. This state map will be persisted across posts.

Parameters:
request -
name -
value -

isCommandDirty

public boolean isCommandDirty(javax.servlet.http.HttpServletRequest request)

setCommandDirty

public void setCommandDirty(javax.servlet.http.HttpServletRequest request)

setCommandClean

public void setCommandClean(javax.servlet.http.HttpServletRequest request)

getStateMapForUrl

protected java.util.Map getStateMapForUrl(javax.servlet.http.HttpServletRequest request)
Gets the state map with parameters only to be included in the url. VALIDATE_MODE_PARAM and COMMAND_DIRTY are removed so they are not reflected in the url. Use this method in preference to the regular getStateMap method when redirecting with url params

Parameters:
request -
Returns:
a state map for use in urls

afterPropertiesSet

public void afterPropertiesSet()
                        throws java.lang.Exception
Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Throws:
java.lang.Exception

processFormSubmission

protected org.springframework.web.servlet.ModelAndView processFormSubmission(javax.servlet.http.HttpServletRequest request,
                                                                             javax.servlet.http.HttpServletResponse response,
                                                                             java.lang.Object command,
                                                                             org.springframework.validation.BindException errors)
                                                                      throws java.lang.Exception
Overrides:
processFormSubmission in class org.springframework.web.servlet.mvc.SimpleFormController
Throws:
java.lang.Exception

setRedirectFormView

public void setRedirectFormView(java.lang.String redirectView)

getRedirectFormView

public java.lang.String getRedirectFormView()

showForm

protected org.springframework.web.servlet.ModelAndView showForm(javax.servlet.http.HttpServletRequest request,
                                                                javax.servlet.http.HttpServletResponse response,
                                                                org.springframework.validation.BindException errors)
                                                         throws java.lang.Exception
Calls the controller pageAccessResolver if it exists and then super.showForm

Overrides:
showForm in class org.springframework.web.servlet.mvc.SimpleFormController
Throws:
java.lang.Exception
See Also:
SimpleFormController.showForm(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, org.springframework.validation.BindException)


Copyright © 2005-2007 Spring Layout Team. All Rights Reserved.