org.riotfamily.common.web.dwr
Class DwrController

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.riotfamily.common.web.dwr.DwrController
All Implemented Interfaces:
BeanFactoryAware, BeanNameAware, InitializingBean, ApplicationContextAware, ServletContextAware, Controller

public class DwrController
extends AbstractController
implements BeanNameAware, InitializingBean, BeanFactoryAware, ServletContextAware


Field Summary
protected  org.directwebremoting.WebContextFactory.WebContextBuilder webContextBuilder
           
 
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
DwrController()
           
 
Method Summary
 void afterPropertiesSet()
          Is called by the Spring container after all properties have been set.
protected  int getPathOffset(HttpServletRequest request)
           
protected  ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response)
          Handles all request to this controller.
 void setBeanFactory(BeanFactory beanFactory)
          Is called by the Spring container to set the bean factory.
 void setBeanName(String beanName)
           
 void setConfigurators(List<?> configurators)
          Sets the configurators to apply to this controller.
 void setIncludeDefaultConfig(boolean includeDefaultConfig)
          Sets whether the default DWR configuration should be included (default is true).
 void setMapping(String mapping)
           
 void setParameters(Map<?,?> parameters)
          Sets parameters just like the init-parameters of the DwrServlet.
 
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
 
Methods inherited from interface org.springframework.web.context.ServletContextAware
setServletContext
 

Field Detail

webContextBuilder

protected org.directwebremoting.WebContextFactory.WebContextBuilder webContextBuilder
Constructor Detail

DwrController

public DwrController()
Method Detail

setMapping

public void setMapping(String mapping)

setBeanName

public void setBeanName(String beanName)
Specified by:
setBeanName in interface BeanNameAware

setBeanFactory

public void setBeanFactory(BeanFactory beanFactory)
                    throws BeansException
Is called by the Spring container to set the bean factory. This bean factory is then used to obtain the global DWR configuration from. This global configuration is optional as DWR will provide defaults where possible.

Specified by:
setBeanFactory in interface BeanFactoryAware
Throws:
BeansException

setConfigurators

public void setConfigurators(List<?> configurators)
Sets the configurators to apply to this controller. The configurators are used to set up DWR correctly.


setParameters

public void setParameters(Map<?,?> parameters)
Sets parameters just like the init-parameters of the DwrServlet.


setIncludeDefaultConfig

public void setIncludeDefaultConfig(boolean includeDefaultConfig)
Sets whether the default DWR configuration should be included (default is true).

This default configuration contains all build-in creators and converters. You normally want this default configuration to be included.


afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Is called by the Spring container after all properties have been set. This method actually makes sure the container is correctly initialized and all configurators are processed.

Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
Exception - in case setting up fails

handleRequestInternal

protected ModelAndView handleRequestInternal(HttpServletRequest request,
                                             HttpServletResponse response)
                                      throws Exception
Handles all request to this controller.

It delegates to the UrlProcessor and also takes care of setting and unsetting of the current WebContext.

Specified by:
handleRequestInternal in class AbstractController
Throws:
Exception

getPathOffset

protected int getPathOffset(HttpServletRequest request)