Butter Dev Logo
Search:   

December 6, 2009

DWR 3.x and Spring

If you want to integrate DWR 3.x with Spring you can follow my previous posts (note – I have included a working sample application and updated source at the bottom of this page):

  1. I am using DWR 2.0.x, Spring 2.x, and Spring MVC
  2. I am using DWR 2.0.x, Spring 2.x, but I am not using Spring MVC

However, you will need to make the following changes.

Spring 2.5 or greater is Required

You must upgrade to Spring 2.5 or higher (I am using Spring 3.0.4).

Update you Spring Application Context

Update your Spring Application Context:

<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:aop="http://www.springframework.org/schema/aop"
    xmlns:dwr="http://www.directwebremoting.org/schema/spring-dwr"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans-.0.xsd
    http://www.springframework.org/schema/aop
    http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
    http://www.directwebremoting.org/schema/spring-dwr
    http://www.directwebremoting.org/schema/spring-dwr-3.0.xsd">

I have added two working examples (~10 mb in size), both of these zip files contain all source as well as a working web-app that you can drop into your container:

2 responses to “DWR 3.x and Spring”

  1. vinny says:

    note that the 2nd line from the bottom is missing a ‘/’ after “http:”

    might save you a few minutes of beating your head on the table 🙂

  2. Fixed, thanks Vinny.

Leave a Reply