public class AddPersonController
extends org.springframework.web.servlet.mvc.SimpleFormController
| Modifier and Type | Field and Description |
|---|---|
protected org.apache.commons.logging.Log |
log
Logger for this class and subclasses
|
DEFAULT_COMMAND_NAME| Constructor and Description |
|---|
AddPersonController() |
| Modifier and Type | Method and Description |
|---|---|
protected List<PersonListItem> |
formBackingObject(javax.servlet.http.HttpServletRequest request)
This is called prior to displaying a form for the first time.
|
protected org.springframework.web.servlet.ModelAndView |
onSubmit(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
Object command,
org.springframework.validation.BindException errors)
Submit callback with all parameters.
|
org.springframework.web.servlet.ModelAndView |
showForm(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.validation.BindException errors)
Prepares the form view
|
doSubmitAction, getFormView, getSuccessView, isFormChangeRequest, isFormChangeRequest, onFormChange, onFormChange, onSubmit, onSubmit, processFormSubmission, referenceData, referenceData, setFormView, setSuccessView, showForm, suppressValidationcurrentFormObject, getCommand, getErrorsForNewForm, getFormSessionAttributeName, getFormSessionAttributeName, handleInvalidSubmit, handleRequestInternal, isBindOnNewForm, isFormSubmission, isSessionForm, onBindOnNewForm, onBindOnNewForm, setBindOnNewForm, setSessionForm, showForm, showForm, showNewFormbindAndValidate, checkCommand, createBinder, createCommand, getBindingErrorProcessor, getCommandClass, getCommandName, getMessageCodesResolver, getPropertyEditorRegistrars, getValidator, getValidators, getWebBindingInitializer, initApplicationContext, initBinder, isValidateOnBinding, onBind, onBind, onBindAndValidate, prepareBinder, setBindingErrorProcessor, setCommandClass, setCommandName, setMessageCodesResolver, setPropertyEditorRegistrar, setPropertyEditorRegistrars, setValidateOnBinding, setValidator, setValidators, setWebBindingInitializer, suppressBinding, suppressValidation, suppressValidation, useDirectFieldAccesshandleRequest, isSynchronizeOnSession, setSynchronizeOnSessionapplyCacheSeconds, applyCacheSeconds, cacheForSeconds, cacheForSeconds, checkAndPrepare, checkAndPrepare, getCacheSeconds, getSupportedMethods, isAlwaysMustRevalidate, isRequireSession, isUseCacheControlHeader, isUseCacheControlNoStore, isUseExpiresHeader, preventCaching, setAlwaysMustRevalidate, setCacheSeconds, setRequireSession, setSupportedMethods, setUseCacheControlHeader, setUseCacheControlNoStore, setUseExpiresHeadergetServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContextprotected final org.apache.commons.logging.Log log
protected org.springframework.web.servlet.ModelAndView onSubmit(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
Object command,
org.springframework.validation.BindException errors)
throws Exception
org.springframework.web.servlet.mvc.SimpleFormControllerThe default implementation delegates to SimpleFormController.onSubmit(Object, BindException).
For simply performing a submit action and rendering the specified success
view, consider implementing SimpleFormController.doSubmitAction(java.lang.Object) rather than an
onSubmit variant.
Subclasses can override this to provide custom submission handling like storing the object to the database. Implementations can also perform custom validation and call showForm to return to the form. Do not implement multiple onSubmit methods: In that case, just this method will be called by the controller.
Call errors.getModel() to populate the ModelAndView model
with the command and the Errors instance, under the specified command name,
as expected by the "spring:bind" tag.
onSubmit in class org.springframework.web.servlet.mvc.SimpleFormControllerrequest - current servlet requestresponse - current servlet responsecommand - form object with request parameters bound onto iterrors - Errors instance without errors (subclass can add errors if it wants to)nullException - in case of errorsSimpleFormController.onSubmit(javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse, java.lang.Object,
org.springframework.validation.BindException)protected List<PersonListItem> formBackingObject(javax.servlet.http.HttpServletRequest request) throws javax.servlet.ServletException
formBackingObject in class org.springframework.web.servlet.mvc.AbstractFormControllerrequest - current HTTP requestjavax.servlet.ServletExceptionAbstractFormController.formBackingObject(javax.servlet.http.HttpServletRequest)public org.springframework.web.servlet.ModelAndView showForm(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.validation.BindException errors)
throws Exception
showForm in class org.springframework.web.servlet.mvc.SimpleFormControllerrequest - current HTTP requestresponse - current HTTP responseerrors - validation errors holdernull if handled directlyException - in case of invalid state or argumentsSimpleFormController.setFormView(java.lang.String),
SimpleFormController.showForm(HttpServletRequest, HttpServletResponse, BindException, Map)Copyright © 2015 OpenMRS Inc.. All rights reserved.