org.shept.org.springframework.web.servlet.mvc.delegation
Class MultiActionController

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.shept.org.springframework.web.servlet.mvc.delegation.DelegatingController
                      extended by org.shept.org.springframework.web.servlet.mvc.delegation.MultiActionController
All Implemented Interfaces:
org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware, org.springframework.web.context.ServletContextAware, org.springframework.web.servlet.mvc.Controller, org.springframework.web.servlet.mvc.LastModified
Direct Known Subclasses:
SheptController

public class MultiActionController
extends DelegatingController

Version:
$$Id: MultiActionController.java 110 2011-02-21 09:16:15Z aha $$
Author:
Andi

Field Summary
private static String CLEAR_FORM_CACHE_PARAM
           
protected  String clearCacheParam
           
protected  boolean enableClearCache
           
private static String FORM_TITLE_MODEL_ATTRIBUTE
           
protected  SessionFormCache formCache
           
private  String formTitleAttribute
           
protected  CommandObjectProvider objectProvider
           
private  String titleCode
           
 
Fields inherited from class org.shept.org.springframework.web.servlet.mvc.delegation.DelegatingController
DEFAULT_COMMAND_NAME, LAST_MODIFIED_METHOD_SUFFIX, PAGE_NOT_FOUND_LOG_CATEGORY, pageNotFoundLogger
 
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
MultiActionController()
           
 
Method Summary
protected  Object buildCommandObject(javax.servlet.http.HttpServletRequest request)
           
 String getClearCacheParam()
           
protected  Object getCommandObject(javax.servlet.http.HttpServletRequest request, Class clazz)
          Create a new command object of the given class.
 SessionFormCache getFormCache()
           
 String getFormTitleAttribute()
           
 long getLastModified(javax.servlet.http.HttpServletRequest request)
          Try to find an XXXXLastModified method, where XXXX is the name of a handler.
protected  org.springframework.web.servlet.ModelAndView handleRequestInternal(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Determine a handler method and invoke it.
protected  void postProcessModel(javax.servlet.http.HttpServletRequest request, org.springframework.web.servlet.ModelAndView mav)
           
 void setClearCacheParam(String clearCacheParam)
           
 void setEnableClearCache(boolean enableClearCache)
           
 void setFormCache(SessionFormCache formCache)
           
 void setFormTitleAttribute(String formTitleAttribute)
           
 void setObjectProvider(CommandObjectProvider objectProvider)
           
 void setTitleCode(String titleCode)
           
 
Methods inherited from class org.shept.org.springframework.web.servlet.mvc.delegation.DelegatingController
afterPropertiesSet, createBinder, getCommandName, getFormView, getRedirectUrl, getWebBindingInitializer, handleNoSuchRequestHandlingMethod, initBinder, massageReturnValueIfNecessary, setActionResolver, setBeanName, setCommandClass, setDelegates, setFormView, setRedirectUrl, setWebBindingInitializer
 
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, isUseCacheControlNoStore, isUseExpiresHeader, preventCaching, 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, initApplicationContext, requiredContextClass, setApplicationContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLEAR_FORM_CACHE_PARAM

private static String CLEAR_FORM_CACHE_PARAM

FORM_TITLE_MODEL_ATTRIBUTE

private static String FORM_TITLE_MODEL_ATTRIBUTE

clearCacheParam

protected String clearCacheParam

enableClearCache

protected boolean enableClearCache

formCache

protected SessionFormCache formCache

objectProvider

protected CommandObjectProvider objectProvider

formTitleAttribute

private String formTitleAttribute

titleCode

private String titleCode
Constructor Detail

MultiActionController

public MultiActionController()
Method Detail

getCommandObject

protected Object getCommandObject(javax.servlet.http.HttpServletRequest request,
                                  Class clazz)
                           throws Exception
Description copied from class: DelegatingController
Create a new command object of the given class.

This implementation uses BeanUtils.instantiateClass, so commands need to have public no-arg constructors. Subclasses can override this implementation if desired.

Overrides:
getCommandObject in class DelegatingController
Throws:
Exception - if the command object could not be instantiated
See Also:
BeanUtils.instantiateClass(Class)

buildCommandObject

protected Object buildCommandObject(javax.servlet.http.HttpServletRequest request)

handleRequestInternal

protected org.springframework.web.servlet.ModelAndView handleRequestInternal(javax.servlet.http.HttpServletRequest request,
                                                                             javax.servlet.http.HttpServletResponse response)
                                                                      throws Exception
Description copied from class: DelegatingController
Determine a handler method and invoke it.

Overrides:
handleRequestInternal in class DelegatingController
Throws:
Exception
See Also:
MethodNameResolver.getHandlerMethodName(javax.servlet.http.HttpServletRequest), #invokeNamedMethod, DelegatingController.handleNoSuchRequestHandlingMethod(org.springframework.web.servlet.mvc.multiaction.NoSuchRequestHandlingMethodException, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)

postProcessModel

protected void postProcessModel(javax.servlet.http.HttpServletRequest request,
                                org.springframework.web.servlet.ModelAndView mav)
                         throws Exception
Overrides:
postProcessModel in class DelegatingController
Throws:
Exception

getFormCache

public SessionFormCache getFormCache()
Returns:
the sessionFormCache

setFormCache

public void setFormCache(SessionFormCache formCache)
Parameters:
sessionFormCache - the sessionFormCache to set

getLastModified

public long getLastModified(javax.servlet.http.HttpServletRequest request)
Description copied from class: DelegatingController
Try to find an XXXXLastModified method, where XXXX is the name of a handler. Return -1 if there's no such handler, indicating that content must be updated.

Specified by:
getLastModified in interface org.springframework.web.servlet.mvc.LastModified
Overrides:
getLastModified in class DelegatingController
See Also:
LastModified.getLastModified(HttpServletRequest)

setObjectProvider

public void setObjectProvider(CommandObjectProvider objectProvider)
Parameters:
objectProvider - the objectProvider to set

getClearCacheParam

public String getClearCacheParam()
Returns:
the clearCacheParam

setClearCacheParam

public void setClearCacheParam(String clearCacheParam)
Parameters:
clearCacheParam - the clearCacheParam to set

setEnableClearCache

public void setEnableClearCache(boolean enableClearCache)
Parameters:
enableClearCache - the enableClearCache to set

setTitleCode

public void setTitleCode(String titleCode)
Parameters:
titleCode - the titleCode to set

getFormTitleAttribute

public String getFormTitleAttribute()
Returns:
the formTitleAttribute

setFormTitleAttribute

public void setFormTitleAttribute(String formTitleAttribute)
Parameters:
formTitleAttribute - the formTitleAttribute to set


Copyright © 2011. All Rights Reserved.