February 20, 2008
DWR and Spring – A configuration for everyone
DWR and Spring is a great combination. The Spring integration in DWR can support many configurations but many times this can lead to confusion. The goal of this article is to provide developers with a working skeleton for several common enironments (using Spring MVC, not using Spring MVC, using the DWR Namespace, etc.).
References
Before we get started here are some additional references on DWR/Spring.
- Official DWR Documentation
- Bram Smeets and Jose Noheda have blogged about the integration between DWR and Spring.
The DWR Namespace Handler:
Spring 2.x includes a new “XML Namespace Handlers” feature. DWR 2.x allows you to leverage this feature through a custom namespace — eliminating the need for the DWR configuration file (dwr.xml). If you are using DWR 2.0.x and Spring 2.x this is the recommended approach if you want seamless integration (almost) between DWR and Spring.
There are two configurations to consider, please select a link for a detailed description and to download a fully functioning basic example:
- I am using DWR 2.0.x, Spring 2.x, and Spring MVC
- I am using DWR 2.0.x, Spring 2.x, but I am not using Spring MVC
- I am using DWR 3.x …
dwr.xml:
If you are using an older version (pre 2.x) of DWR or Spring, DWR still provides integration with Spring through the Spring Creator. This configuration requires a dwr.xml configuration. Information on this set-up is covered in the DWR manual.
