| |
|
| org.directwebremoting.spring.DwrController
DwrController | public class DwrController extends AbstractController implements BeanNameAware,InitializingBean,BeanFactoryAware(Code) | | A Spring Controller that handles DWR requests.
Using this controller allows you to configure DWR entirely in Spring. You do not have to create
a separate dwr.xml configuration file when using this controller.
The following configuration provides a basic example of how too define this controller as a bean
in your application context.
<bean id="dwrController" class="org.directwebremoting.spring.DwrController">
<property name="configurators">
<list>
<ref bean="dwrConfiguration"/>
</list>
</property>
<property name="debug" value="true"/>
</bean>
<bean id="dwrConfiguration" class="org.directwebremoting.spring.SpringConfigurator">
<property name="creators">
<map>
<entry key="beanName">
<bean class="org.directwebremoting.spring.CreatorConfig">
<property name="creator">
<bean class="org.directwebremoting.spring.BeanCreator">
<property name="bean" ref="BeanName"/>
</bean>
</property>
</bean>
</entry>
</map>
</property>
</bean>
<-- the bean you want to remote using DWR -->
<bean id="beanName" class="BeanName"/>
In the near future we want to provide a DWR namespace for Spring, which should allow you to
something like the following:
<dwr:configuration>
<debug/>
</dwr:configuration>
<-- the bean you want to remote using DWR -->
<bean id="beanName" class="BeanName">
<dwr:remote javascript="beanName"/>
</bean>
Which should be equivalent to the previous example. Please note that this is still work in progress
and is therefore subject to change.
author: Joe Walker [joe at getahead dot ltd dot uk] author: Bram Smeets |
afterPropertiesSet | public void afterPropertiesSet() throws Exception(Code) | | 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.
throws: Exception - in case setting up fails See Also: org.springframework.beans.factory.InitializingBean.afterPropertiesSet |
handleRequestInternal | protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response) throws Exception(Code) | | Handles all request to this controller.
It delegates to the UrlProcessor and also takes case of setting and unsetting of the
current WebContext .
Parameters: request - the request to handle Parameters: response - the response to handle throws: Exception - in case handling of the request fails unexpectedly See Also: org.directwebremoting.WebContext |
setBeanFactory | public void setBeanFactory(BeanFactory beanFactory) throws BeansException(Code) | | 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.
See Also: org.springframework.beans.factory.BeanFactoryAware.setBeanFactory(org.springframework.beans.factory.BeanFactory) |
setBeanName | public void setBeanName(String name)(Code) | | Is called by the Spring container to set the name of this bean.
Parameters: name - the name of this bean in the Spring container See Also: BeanNameAware.setBeanName(String) |
setConfigurators | public void setConfigurators(List<Configurator> configurators)(Code) | | Sets the configurators to apply to this controller.
The configurators are used to set up DWR correctly.
Parameters: configurators - the configurators to apply to this controller |
setDebug | public void setDebug(boolean debug)(Code) | | Sets whether DWR should be in debug mode (default is false ).
This allows access to the debug pages provided by DWR under /[WEBAPP]/dwr/ .
NOTE: make sure to not set this property to true in a production environment.
Parameters: debug - the indication of whether to start DWR in debug mode |
setIncludeDefaultConfig | public void setIncludeDefaultConfig(boolean includeDefaultConfig)(Code) | | 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.
Parameters: includeDefaultConfig - the indication of whether to include the default configuration |
|
|
|