Class BaseFormController

  • All Implemented Interfaces:
    org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware, org.springframework.web.context.ServletContextAware, org.springframework.web.servlet.mvc.Controller
    Direct Known Subclasses:
    ArrayDesignFormController

    @Deprecated
    public abstract class BaseFormController
    extends org.springframework.web.servlet.mvc.SimpleFormController
    Deprecated.
    SimpleFormController is deprecated, use annotations-based GET/POST mapping instead.
    Implementation of SimpleFormController that contains convenience methods for subclasses. For example, getting the current user and saving messages/errors. This class is intended to be a base class for all Form controllers.
    Author:
    pavlidis (originally based on Appfuse code)
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static org.apache.commons.logging.Log log
      Deprecated.
       
      protected MessageUtil messageUtil
      Deprecated.
       
      • Fields inherited from class org.springframework.web.servlet.mvc.BaseCommandController

        DEFAULT_COMMAND_NAME
      • Fields inherited from class org.springframework.web.servlet.support.WebContentGenerator

        METHOD_GET, METHOD_HEAD, METHOD_POST
      • Fields inherited from class org.springframework.context.support.ApplicationObjectSupport

        logger
    • Constructor Summary

      Constructors 
      Constructor Description
      BaseFormController()
      Deprecated.
       
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      protected org.springframework.web.servlet.ModelAndView getCancelView​(javax.servlet.http.HttpServletRequest request)
      Deprecated.
      Override this to control which cancelView is used.
      protected void initBinder​(org.springframework.web.bind.WebDataBinder binder)
      Deprecated.
      Set up a custom property editor for converting form inputs to real objects.
      protected org.springframework.web.servlet.ModelAndView processErrors​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Object command, org.springframework.validation.BindException errors, String message)
      Deprecated.
      Convenience method to get the user object from the session
      protected org.springframework.web.servlet.ModelAndView processFormSubmission​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Object command, org.springframework.validation.BindException errors)
      Deprecated.
      Default behavior for FormControllers - redirect to the successView when the cancel button has been pressed.
      • Methods inherited from class org.springframework.web.servlet.mvc.SimpleFormController

        doSubmitAction, getFormView, getSuccessView, isFormChangeRequest, isFormChangeRequest, onFormChange, onFormChange, onSubmit, onSubmit, onSubmit, referenceData, referenceData, setFormView, setSuccessView, showForm, showForm, suppressValidation
      • Methods inherited from class org.springframework.web.servlet.mvc.AbstractFormController

        currentFormObject, formBackingObject, getCommand, getErrorsForNewForm, getFormSessionAttributeName, getFormSessionAttributeName, handleInvalidSubmit, handleRequestInternal, isBindOnNewForm, isFormSubmission, isSessionForm, onBindOnNewForm, onBindOnNewForm, setBindOnNewForm, setSessionForm, showForm, showForm, showNewForm
      • Methods inherited from class org.springframework.web.servlet.mvc.BaseCommandController

        bindAndValidate, 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, useDirectFieldAccess
      • 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, isAlwaysMustRevalidate, isRequireSession, isUseCacheControlHeader, isUseCacheControlNoStore, isUseExpiresHeader, preventCaching, setAlwaysMustRevalidate, setCacheSeconds, setRequireSession, setSupportedMethods, setUseCacheControlHeader, setUseCacheControlNoStore, setUseExpiresHeader
      • Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport

        getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
      • Methods inherited from class org.springframework.context.support.ApplicationObjectSupport

        getApplicationContext, getMessageSourceAccessor, requiredContextClass, setApplicationContext
    • Field Detail

      • log

        protected static final org.apache.commons.logging.Log log
        Deprecated.
      • messageUtil

        @Autowired
        protected MessageUtil messageUtil
        Deprecated.
    • Constructor Detail

      • BaseFormController

        public BaseFormController()
        Deprecated.
    • Method Detail

      • getCancelView

        protected org.springframework.web.servlet.ModelAndView getCancelView​(javax.servlet.http.HttpServletRequest request)
        Deprecated.
        Override this to control which cancelView is used. The default behavior is to go to the success view if there is no cancel view defined; otherwise, get the cancel view.
        Parameters:
        request - can be used to control which cancel view to use. (This is not used in the default implementation)
        Returns:
        the view to use.
      • initBinder

        @InitBinder
        protected void initBinder​(org.springframework.web.bind.WebDataBinder binder)
        Deprecated.
        Set up a custom property editor for converting form inputs to real objects. Override this to add additional custom editors (call super.initBinder() in your implementation)
      • processErrors

        protected org.springframework.web.servlet.ModelAndView processErrors​(javax.servlet.http.HttpServletRequest request,
                                                                             javax.servlet.http.HttpServletResponse response,
                                                                             Object command,
                                                                             org.springframework.validation.BindException errors,
                                                                             String message)
                                                                      throws Exception
        Deprecated.
        Convenience method to get the user object from the session
        Parameters:
        request - the current request
        Returns:
        the user's populated object from the session
        Throws:
        Exception
      • processFormSubmission

        protected org.springframework.web.servlet.ModelAndView processFormSubmission​(javax.servlet.http.HttpServletRequest request,
                                                                                     javax.servlet.http.HttpServletResponse response,
                                                                                     Object command,
                                                                                     org.springframework.validation.BindException errors)
                                                                              throws Exception
        Deprecated.
        Default behavior for FormControllers - redirect to the successView when the cancel button has been pressed.
        Overrides:
        processFormSubmission in class org.springframework.web.servlet.mvc.SimpleFormController
        Throws:
        Exception