Class ElementComponentController
- java.lang.Object
-
- org.springframework.context.support.ApplicationObjectSupport
-
- org.springframework.web.context.support.WebApplicationObjectSupport
-
- org.springframework.web.servlet.support.WebContentGenerator
-
- org.springframework.web.servlet.mvc.AbstractController
-
- org.springframework.web.servlet.mvc.BaseCommandController
-
- org.springframework.web.servlet.mvc.AbstractFormController
-
- org.springframework.web.servlet.mvc.SimpleFormController
-
- nl.gx.webmanager.springmvc.controller.BaseWebmanagerController
-
- nl.gx.webmanager.springmvc.controller.component.ComponentController
-
- nl.gx.webmanager.springmvc.controller.component.ElementComponentController
-
- All Implemented Interfaces:
DelegatedController
,ComponentAware
,org.springframework.beans.factory.Aware
,org.springframework.context.ApplicationContextAware
,org.springframework.web.context.ServletContextAware
,org.springframework.web.servlet.mvc.Controller
public class ElementComponentController extends ComponentController
This class is the delegation controller for elements. Note that this controller is not running in the Spring application context. It is only used for controller delegation from a MainSpringController which runs inside the Spring application context. Custom controllers for element components should extend this class.- Since:
- WebManager 9.0.8
- Author:
- ivol
-
-
Field Summary
-
Fields inherited from class nl.gx.webmanager.springmvc.controller.BaseWebmanagerController
formBackingObject, PROTOCOL_PROCESSED_KEY
-
Fields inherited from class org.springframework.web.servlet.mvc.BaseCommandController
DEFAULT_COMMAND_NAME
-
-
Constructor Summary
Constructors Constructor Description ElementComponentController()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected void
createEditViews()
Callback to add edit views.Object
formBackingObject(javax.servlet.http.HttpServletRequest request)
Retrieve a form backing object for the current form from the given request.Element
getElement()
USed for backwards compatibility with legacy templatesprotected void
initFormBackingObject(Element element, Element fbo)
Deprecated.void
onSubmit(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Object command, org.springframework.validation.BindException errors, org.springframework.web.servlet.ModelAndView modelAndView)
Override this method to implement specific logic which must be executed upon submitting the page.void
setElement(Element element)
Invoked by ElementBase on construction-
Methods inherited from class nl.gx.webmanager.springmvc.controller.component.ComponentController
addEditView, addEditView, createResourceBaseNames, getBundleDefinitionId, getComponent, getParentController, onSubmit, onSubmit, onSubmit, referenceData, setBundleDefinitionId, setComponent, setDelegatedControllers, setParentController, showForm
-
Methods inherited from class nl.gx.webmanager.springmvc.controller.BaseWebmanagerController
addControllerDelegation, addDisallowedField, addEditView, addEditView, addEditViews, addResourceBaseName, addValidator, getControllerDelegationMap, getEditContext, getEditLanguageLabel, getEditView, getEditViewByValue, getEditViews, getPresentationContext, getResourceBaseNames, getServletContextHack, getVersion, getWebsite, getWebsiteByRequest, getWmSession, initBinder, initialize, isReloadWebManager, onBind, onBindAndValidate, popNestedPath, pushNestedPath, referenceData, removeControllerDelegation, setReloadWebManager, showForm
-
Methods inherited from class org.springframework.web.servlet.mvc.SimpleFormController
doSubmitAction, getFormView, getSuccessView, isFormChangeRequest, isFormChangeRequest, onFormChange, onFormChange, processFormSubmission, setFormView, setSuccessView, suppressValidation
-
Methods inherited from class org.springframework.web.servlet.mvc.AbstractFormController
currentFormObject, 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, isValidateOnBinding, onBind, 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
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface nl.gx.webmanager.springmvc.DelegatedController
addValidator, getControllerDelegationMap, getEditView, getEditViewByValue, getResourceBaseNames, getValidators, initBinder, initialize, onBind, onBindAndValidate, referenceData
-
-
-
-
Method Detail
-
formBackingObject
public Object formBackingObject(javax.servlet.http.HttpServletRequest request) throws javax.servlet.ServletException
Retrieve a form backing object for the current form from the given request. This method returns the element the controller was created from by default, override to return a custom form backing object.- Specified by:
formBackingObject
in interfaceDelegatedController
- Overrides:
formBackingObject
in classComponentController
- Parameters:
request
- current HTTP request- Returns:
- the FormBackingObject
- Throws:
Exception
- in case of invalid state or argumentsjavax.servlet.ServletException
- in case of errors
-
initFormBackingObject
@Deprecated protected void initFormBackingObject(Element element, Element fbo)
Deprecated.Initialize element form backing object with default values This method is deprecated: use the BeanUtils class contained by the spring framework instead:BeanUtils.copyProperties(element, formBackingObject);
- Parameters:
element
- Element entity to retrieve properties fromfbo
- Element form backing object to set properties on
-
onSubmit
public void onSubmit(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Object command, org.springframework.validation.BindException errors, org.springframework.web.servlet.ModelAndView modelAndView) throws Exception
Override this method to implement specific logic which must be executed upon submitting the page. Note that returning a ModelAndView in this method does not have any effect since the MainSpringController will be in charge of returning the ModelAndView, which is a RedirectView in case of a page submit.- Specified by:
onSubmit
in interfaceDelegatedController
- Overrides:
onSubmit
in classBaseWebmanagerController
- Parameters:
request
- current servlet requestresponse
- current servlet responsecommand
- form backing object to which request parameters are bounderrors
- Errors instance without errors (subclass can add errors if it wants to)modelAndView
- the model and view prepared by the main spring controller- Throws:
Exception
- in case of errors
-
createEditViews
protected void createEditViews()
Description copied from class:BaseWebmanagerController
Callback to add edit views. Sub classes should implement this method, call the super and invoke addEditViews to add its own edit views to the controller.- Specified by:
createEditViews
in classBaseWebmanagerController
-
getElement
public final Element getElement()
USed for backwards compatibility with legacy templates- Returns:
-
setElement
public final void setElement(Element element)
Invoked by ElementBase on construction- Parameters:
element
- Element managed this controller. This is not the form backing object, unless form backing object and business object are one and the same object
-
-