public class AcceptTermsController extends BaseFormController
Modifier and Type | Field and Description |
---|---|
static String |
ACCEPT_TERMS_SEND
value for the hidden form field.
|
static String |
PARAM_SEND
param to determine if the form was sent.
|
DEFAULT_COMMAND_NAME
Constructor and Description |
---|
AcceptTermsController() |
Modifier and Type | Method and Description |
---|---|
protected Object |
formBackingObject(javax.servlet.http.HttpServletRequest request) |
protected org.springframework.web.servlet.ModelAndView |
handleOnSubmit(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
Object command,
org.springframework.validation.BindException errors)
Is called by
BaseFormController.onSubmit(HttpServletRequest, HttpServletResponse, Object, BindException)
Submit callback with all parameters. |
protected org.springframework.web.servlet.ModelAndView |
handleRequestInternal(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
void |
setErrorRedirectTarget(String errorTarget)
Sets the error redirect target.
|
void |
setStartpageRegistry(StartpageRegistry startpageRegistry)
Set the start-page registry which will be used to resolve the redirect targets if
successRedirectTarget or errorRedirectTarget are undefined.
|
void |
setSuccessRedirectTarget(String successTarget)
Sets the success redirect target.
|
void |
setTargetUrlParameter(String targetUrlParameter)
Name of a request parameter to check for a URL to redirect to instead of the configured
static successRedirectTarget or errorRedirectTarget.
|
protected boolean |
suppressValidation(javax.servlet.http.HttpServletRequest request,
Object command) |
getLocale, initBinder, isRefuseOnExternalAuthentication, onSubmit, onSubmit, onSubmit, setRefuseOnExternalAuthentication, showForm
doSubmitAction, getFormView, getSuccessView, isFormChangeRequest, isFormChangeRequest, onFormChange, onFormChange, processFormSubmission, referenceData, referenceData, setFormView, setSuccessView, showForm
currentFormObject, getCommand, getErrorsForNewForm, getFormSessionAttributeName, getFormSessionAttributeName, handleInvalidSubmit, isBindOnNewForm, isFormSubmission, isSessionForm, onBindOnNewForm, onBindOnNewForm, setBindOnNewForm, setSessionForm, showForm, showForm, showNewForm
bindAndValidate, checkCommand, createBinder, createCommand, getBindingErrorProcessor, getCommandClass, getCommandName, getMessageCodesResolver, getPropertyEditorRegistrars, getValidator, getValidators, getWebBindingInitializer, initApplicationContext, isValidateOnBinding, onBind, onBind, onBindAndValidate, prepareBinder, setBindingErrorProcessor, setCommandClass, setCommandName, setMessageCodesResolver, setPropertyEditorRegistrar, setPropertyEditorRegistrars, setValidateOnBinding, setValidator, setValidators, setWebBindingInitializer, suppressBinding, suppressValidation, suppressValidation, useDirectFieldAccess
handleRequest, isSynchronizeOnSession, setSynchronizeOnSession
applyCacheSeconds, applyCacheSeconds, cacheForSeconds, cacheForSeconds, checkAndPrepare, checkAndPrepare, getCacheSeconds, getSupportedMethods, isAlwaysMustRevalidate, isRequireSession, isUseCacheControlHeader, isUseCacheControlNoStore, isUseExpiresHeader, preventCaching, setAlwaysMustRevalidate, setCacheSeconds, setRequireSession, setSupportedMethods, setUseCacheControlHeader, setUseCacheControlNoStore, setUseExpiresHeader
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
public static final String ACCEPT_TERMS_SEND
public static final String PARAM_SEND
protected Object formBackingObject(javax.servlet.http.HttpServletRequest request) throws Exception
formBackingObject
in class org.springframework.web.servlet.mvc.AbstractFormController
Exception
protected org.springframework.web.servlet.ModelAndView handleOnSubmit(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Object command, org.springframework.validation.BindException errors) throws Exception
BaseFormController
BaseFormController.onSubmit(HttpServletRequest, HttpServletResponse, Object, BindException)
The default implementation delegates to BaseFormController.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.
handleOnSubmit
in class BaseFormController
request
- 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)null
Exception
- in case of errorsBaseFormController.onSubmit(Object, BindException)
,
SimpleFormController.doSubmitAction(java.lang.Object)
,
BaseFormController.showForm(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, org.springframework.validation.BindException)
,
Errors
,
BindException.getModel()
protected org.springframework.web.servlet.ModelAndView handleRequestInternal(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws Exception
handleRequestInternal
in class org.springframework.web.servlet.mvc.AbstractFormController
Exception
public void setErrorRedirectTarget(String errorTarget)
errorTarget
- the new error redirect targetpublic void setStartpageRegistry(StartpageRegistry startpageRegistry)
startpageRegistry
- the registrypublic void setSuccessRedirectTarget(String successTarget)
successTarget
- the new success redirect targetpublic void setTargetUrlParameter(String targetUrlParameter)
targetUrlParameter
- name of the parameter that holds the target URL. The parameter name is expected to
consist only of ASCII alpha-numeric characters.protected boolean suppressValidation(javax.servlet.http.HttpServletRequest request, Object command)
suppressValidation
in class org.springframework.web.servlet.mvc.SimpleFormController
Copyright © 2019 Communote team. All rights reserved.