Blog on Spring and DWR. AJAX with Spring made easy!

Spring & DWR - Ajax made Easy

Filed under: Ajax, Java, Spring — Bram Smeets at 9:55 am on Wednesday, January 31, 2007

Direct Web Remoting (DWR) is an Open Source initiative that provides easy Ajax for Java. Besides being the best Ajax framework for Java developers, it has one more big feature, at least in my opinion. It integrates very nicely with Spring, by provides the means to easily remote your spring-managed beans to JavaScript. However, up until now there has always been a very loose coupling between the DWR configuration and the Spring configuration. For more information on how DWR was configured to work with Spring in the past see one of my earlier posts on using DWR in conjunction with Spring (note that it is fairly outdated).

Configure DWR in Spring

Joe and I are pleased to announce that a new configuration mechanism is available when using DWR in conjunction with Spring. Using the new namespace support provided by Spring 2.0 it is possible to incorporate the DWR configuration you would normally configure in your dwr.xml, into your Spring configuration. This means that when using Spring you will no longer need to create a separate dwr.xml, but configure DWR entirely in Spring instead. Next to eliminating the need for an extra configuration file, it also provides a tight coupling between the bean(s) you want to remote and the DWR configuration. Previously this was done by specifying the name/id of the bean you wanted to remote in your DWR configuration. As you will see in a moment, you can now specify the fact that you want to remote a certain bean directly onto that specific bean. This leads to a much more intuitive, readable and maintainable configuration. Two other advantages of using this new way of configuration are that first of all this eliminates the problems we had when directly remoting proxied beans (e.g. transactional services) and secondly eliminates the limitation we had in the past that you could only remote beans that were loaded by a ContextLoaderListener and not those defined in your xxx-servlet.xml.

Of course you do not need to use this new configuration mechanism, you can choose to keep using the old way of configuring DWR. But if you take a look at the new mechanism, I am fairly sure that you will be just as enthusiastic as I am about this new feature!

Please note that the DWR namespace is only available when using DWR version 2.0-rc2 or higher. It is also heavily dependent on the namespace support provided by Spring 2.0, so you need to include this on your classpath as well (preferably the latest version, currently 2.0.2).

Enough talk, let us have a look at sample configuration. Assume the following Spring configuration file:

<?xml version="1.0" encoding="UTF-8"?>
<beans 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-2.0.xsd">
<bean id="myService" class="example.MyServiceImpl">
<property name="dao" ref="myDao"/>
</bean>
</beans>

First of all, note that we are using the Spring namespace support in the header of the XML document instead of the Spring DTD. This is something which is available since Spring 2.0 and is inherent to using the namespace support. The ajaxFacade bean is just an ordinary bean configured in Spring which has a reference to some Data Access Object (DAO) defined in another application context.

Now, we decide we want to remote this bean to JavaScript using DWR. In that case we need to include the DWR namespace into the header of the document. To include it we change the header to the following:

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

First of all you need to define the XML namespace (xmlns) by providing an alias, in this case dwr and link it to the URI of the schema. Note that the dwr alias can be replaced with anything you want as long as you use your alias in the next examples instead of the dwr one. Changing xmlns:dwr to xmlns:otheralias is all you need to do to change the alias.

Alright, so far for the “hard†part, everything from here will be easy ;-)

If you have an IDE with XML schema support (e.g. IntelliJ and Eclipse) you should navigate inside the myService bean and use the autocomplete functionality to show you all available tags provided by the DWR namespace.

Choose the dwr:remote tag and you will see that the IDE will automatically prompt you for the javascript name to use for exposing the bean. Note that the dwr:remote tag should be a nested tag of the myService bean. So now, the bean myService bean definition should look like the following:

<bean id="myService" class="example.MyServiceImpl">
<dwr:remote javascript="MyAjaxService"/>
<property name="dao" ref="myDao"/>
</bean>

Now, that is all there is to it to configure DWR to remote the myService bean under the JavaScript name “MyAjaxService”. However, we do need to somehow expose DWR to the outside world. Here you have two possibilities where the choice is mostly dependent on whether you are using Spring MVC for your web application in which case you should go with the DwrController or using any other web framework then go with the DwrSpringServlet.

DwrController

If you are already using Spring MVC the DwrController is the most obvious choice. You will benefit from a number of services provided to you by Spring MVC, like localization support. The DwrController is a normal Spring controller which has a property that takes the DWR configuration as a property. The easiest way to use this controller is again use a tag provided by the DWR namespace:

<dwr:controller id="dwrController" debug="true"/>

Note that the debug property is optional and defaults to false. Make sure to map this controller to the path where you want to expose DWR, normally /dwr.

DwrSpringServlet

In case you are not using Spring MVC, you can still use the configuration mechanism introduced here. Just define the org.directwebremoting.spring.DwrSpringServlet in your web.xml and map it to the /dwr/* path. The servlet will automatically retrieve its configuration from the Spring bean container loaded by the ContextLoaderListener.

<servlet>
<servlet-name>dwr</servlet-name>
<servlet-class>org.directwebremoting.spring.DwrSpringServlet</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>true</param-value>
</init-param>
</servlet>

<servlet-mapping>
<servlet-name>dwr</servlet-name>
<url-pattern>/dwr/*</url-pattern>
</servlet-mapping>

I have uploaded a sample skeleton application, which should get you started with using these new features:

DWR-Spring skeleton application

60 Comments »

Comment by Lutz Müller

January 31, 2007 @ 3:03 pm

this is great news indeed! another pesty configfile to kill.

Comment by Nick Carson

February 1, 2007 @ 12:14 am

Wow, this is really good! Thanks for the post.

Quick question: How can I specify scope? Looked through the spring-dwr-2.0.xsd schema but can’t find it defined. If it cannot be defined, what does it default to?

Thanks

Comment by Bram Smeets

February 1, 2007 @ 2:41 am

Thanks for the compliments!

I personally prefer using the scoping mechanism provided by Spring 2 (for information on that either look at my earlier blog post on that topic or at the Spring reference documentation).

But, you are absolutely right, setting DWR scope is something I have not considered yet. I will look into adding it asap.

Comment by Thomas

February 1, 2007 @ 4:13 am

Is there a means to specify signatures information for collections? I couldn’t seem to find one.

Comment by Thomas

February 1, 2007 @ 4:39 am

Of course I discovered the dwr:configuration element after posting the question about signatures. Thanks for the tool.

Comment by Ernzt

February 2, 2007 @ 2:40 am

Hi! Thanks for the great new stuff! I’m just learning, but it seems very logical (already). ;-)
I was wondering if it would be possible to post a “skeleton” of this application, so I can download it straight to my workspace.

This ain’t lazyness, but it’s always something that goes wrong (like now) when I’m trying… :)

Comment by Ernzt

February 2, 2007 @ 3:30 am

Ehm… to give an example of what is not working (probably doin’ stupid, but it still IS kinda hard to comprehend for a newbie)

When I followed the steps you mentioned above, I get this when starting my Tomcat server:

2007-02-02 02:29:27,390 ERROR [org.springframework.web.context.ContextLoader] -
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 9 in XML document from ServletContext resource [/WEB-INF/spring-context.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'beans'.
Caused by:
org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'beans'.

Any hints maybe?

Comment by Ernzt

February 2, 2007 @ 5:05 am

Sorry to bother AGAIN… but still nothing, I’m getting a headache trying. EVERYTHING I do… the SAXParseException gets fired because “beans” are unknown.
Also, in your second code-block above, you mention “http://www.springframework.org/schema/beans/spring-beans.xsd”
Shouldn’t that be “http://www.springframework.org/schema/beans/spring-beans-2.0.xsd”? However, doesn’t matter, my headache is still there, can you please help me out??

Comment by Siva

February 2, 2007 @ 5:58 am

Hi,

Please provide me details of configuring DWRController(i.e, how and where to use dwr:controller element). I have developed my application by using Spring MVC framework. Now I have to make some AJAX call to my Controller. I appreciate your help.

Comment by Ernzt

February 2, 2007 @ 12:37 pm

Ehm… to give an example of what is not working (probably doin’ stupid, but it still IS kinda hard to comprehend for a newbie)

When I followed the steps you mentioned above, I get this when starting my Tomcat server:

2007-02-02 02:29:27,390 ERROR [org.springframework.web.context.ContextLoader] -
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 9 in XML document from ServletContext resource [/WEB-INF/spring-context.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element ‘beans’.
Caused by:
org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element ‘beans’.

Any hints maybe?

Comment by titi wangsa

February 6, 2007 @ 6:41 am

the “beans” errors, you need org.springframework.scripting package, in the spring-support.jar file. i think you also need the scripting engine

Comment by titi wangsa

February 6, 2007 @ 7:58 am

my mistake.. i’m stuck too.. :(

Comment by Mike

February 6, 2007 @ 10:54 pm

Ernzt,

can you post the beginning of your spring-context.xml file? (Up to the tag at a minimum.)

Comment by noon

February 10, 2007 @ 11:07 pm

Hi,

Great article. Is it possible you to put the whole test application to be downloaded, it would save you from 100s of these requests :)

Thanks

Comment by Jose Noheda

February 12, 2007 @ 10:26 am

I’ve blogged a little about this here

Comment by Bram Smeets

February 12, 2007 @ 12:55 pm

I have uploaded a sample skeleton application which should get you up-to-speed using these new features.

You can download the skeleton here:
DWR-Spring skeleton application

Greetings,
Bram

Comment by Rainer Schmitz

February 21, 2007 @ 5:01 pm

Any chance to nest the dwr:remote tag in a lang:groovy tag (instead of bean)? It would be a cool to remote scripted beans this way.

Rainer

Comment by JJ

February 24, 2007 @ 12:32 am

Can you provide an example using DwrController? I tried what you have suggested but my service is not being exposed. It was fine using DwrSpringServlet.

Thank you

Comment by David Cifuentes

March 2, 2007 @ 5:27 pm

I have a question about the DWR Controller…I´m using the new Convention over Configuration feature in Spring 2.0 specifically the ControllerClassNameHandlerMapping, is there a way to map to the “special” DWRController using this HandlerMapping.

Thanks

Comment by marco

March 7, 2007 @ 5:43 pm

hi,
i have a problem when my service returns a custom type.
the http://www.directwebremoting.org/schema/spring-dwr-2.0.xsd
allows to use the tags in

the spring bean definition, but at the deploy time tomcat says:
GRAVE: Context initialization failed
org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Cannot

locate BeanDefinitionDecorator for element [configuration]

I have a service that returns a User object (simple dto) for loggin success. If i don’t use the

converter, the remote call to service works fine but the returned object is null or dwr says: object has

no properties.

my configuration is:

or

Comment by marco

March 7, 2007 @ 5:48 pm

sorry for my previous error posting :(
hi,
i have a problem when my service returns a custom type.
the http://www.directwebremoting.org/schema/spring-dwr-2.0.xsd
allows to use the <dwr:configuration><dwr:convert type=”…” class=”…”/></dwr:configuration> tags in

the spring bean definition, but at the deploy time tomcat says:
GRAVE: Context initialization failed
org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Cannot

locate BeanDefinitionDecorator for element [configuration]

I have a service that returns a User object (simple dto) for loggin success. If i don’t use the

converter, the remote call to service works fine but the returned object is null or dwr says: object has

no properties.

my configuration is:
<bean id=”mservizioLogin” class=”com.rationalgetaway.servizi.impl.ServizioLoginImpl”>
<dwr:remote javascript=”ServizioLogin” /& rt;
<dwr:configuration><dwr:convert type=”bean” class=”Utente”/></dwr:configuration>
</bean>

<bean id=”utente” class=”com.rationalgetaway.dto.sicurezza.Utente”>
<dwr:remote javascript=”Utente” />
</bean>

or

<bean id=”mservizioLogin” class=”com.rationalgetaway.servizi.impl.ServizioLoginImpl”>
<dwr:remote javascript=”ServizioLogin” />
</bean>

<bean id=”utente” class=”com.rationalgetaway.dto.sicurezza.Utente”>
<dwr:remote javascript=”Utente” />
</bean>

Comment by Stian

March 13, 2007 @ 8:34 pm

(…) secondly eliminates the limitation we had in the past that you could only remote beans that were loaded by a ContextLoaderListener and not those defined in your xxx-servlet.xml.

This is good, but now it’s the other way. I can only remote beans defined in xxx-servlet.xml and not those loaded by the ContextLoaderListener. Is it possible to remote beans specified both places (or at least those loaded by the contextloader) when using the Spring configuration method?

Comment by Murali

April 5, 2007 @ 1:12 am

Is it possible to post a Spring config skeleton?

I’m trying to get this to work in Spring 2.03 and DWR rc2.03 but
when I do this:
[code]

[code]

and in my web.xml
[code]

Myapp
org.springframework.web.servlet.DispatcherServlet
1

Myapp
/dwr/*

[/code]
When I access the /dwr/index.html it gives me a list of methods available, but gives me an error:
[code]
[007-04-04 01:32:53,437 WARN [org.directwebremoting.impl.DefaultRemoter] - Method execution failed:
java.lang.IllegalArgumentException: object is not an instance of declaring class
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Metho
[/code]

And if I use the my Spring app throws a null pointer exception.
I’ve asked about it here: http://forum.springframework.org/showthread.php?t=37033
too. Any help would be greatly appreciated.

Comment by Anuj

April 5, 2007 @ 8:26 pm

How to use

, this is was using with plain struts.

with Spring configuration?

Anuj

Comment by Anuj

April 5, 2007 @ 8:27 pm

My comment got messed up cos of tags, ym question is how to use conver converter for bean in spring for DR?

Thanks
Anuj

Comment by Adam

April 12, 2007 @ 2:05 pm

How do I specify a url mapping for the dwr controller. I’ve got this in my spring config…

<bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<property name="urlMap">
<map>
<entry key="/dwr/index.html">
<ref bean="dwrController" />
</entry>
</map>
</property>
</bean>

<dwr:controller id="dwrController" debug="true" />

<dwr:configuration>
<dwr:convert class="com.mrcuk.Column" type="bean" />
</dwr:configuration>

<bean id="dictionaryDao" class="mypackage.dao.DictionaryJdbcDao">
<dwr:remote javascript="DictionaryDao"/>
<property name="dataSource">
<ref bean="dataSource"/>
</property>
</bean>

But a visit to /myapp/dwr/index.html yields zilch. Is the url mapping syntax correct for referencing the dwr controller?
If I comment out the dwr:controller element and re-enter the servlet and servlet-mapping entries in web.xml, I get the DWR info page but no methods are exposed.

Comment by Bram Smeets

April 12, 2007 @ 2:30 pm

You probably mapped /dwr/* in your web.xml, which means that the servlet container will strip off the /dwr/ part of the path. What I usually do is set the property alwaysUseFullPath on the url handler mapping.

The following always works for me:


<bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
  <property name="mappings">
    <props>
      <prop key="/dwr/**/*.*">dwrController</prop>
      <prop key="/dwr/**/*">dwrController</prop>
    </props>
  </property>
  <property name="alwaysUseFullPath" value="true"/>
</bean>

Comment by Adam

April 12, 2007 @ 2:40 pm

Blimey, that was quick and you cleaned up my post! Thanks, I’ll try that later.

Comment by Rakesh Rocks

April 13, 2007 @ 12:38 pm

Hi Marco,

The is global and not tied to your service-bean. So try putting it outside the tag which declares your service.

For example: (Try this in your case)

Good luck
Rakesh Rocks

Comment by Rakesh Rocks

April 13, 2007 @ 12:43 pm


Comment by Rakesh Rocks

April 13, 2007 @ 12:45 pm

Hi Bram,

I had posted sample code for Marco, but it seems that the tags got filtered!
Can you do something about it?

Rocks

Comment by Bram Smeets

April 13, 2007 @ 4:23 pm

It is really annoying, but Wordpress seems to do that to tags in a post.
You have to explicitly escape all tags (so use < and >) in your post.

Sorry about that…

Comment by Max Ishchenko

April 15, 2007 @ 4:13 pm

So what about Rainer Schmitz previously post? It was about using <dwr:remote> in <lang:groovy>.
I looked through spring xsd’s and it seems that they don’t allow any custom content to be present inside script definitions, but inside <bean> element it’s ok. Thus, we hope Bram will suggest a workaround for the case.

But what if we hack spring-lang-2.0.xsd to allow inside ? Then we’ll have to update spring.jar with hacked xsd and hope that DwrNamespaceHandler will recieve the bean for processing… But something tells me we won’t be lucky enough to succeed :)

Comment by Bram Smeets

April 16, 2007 @ 9:29 am

I have not yet encountered this.
Hacking the spring lang namespace does not seem like the right approach to me ;-)

I’m not sure which namespace handler will get called first, but there is one simple way to find out…

I’m sorry that I can not help you with this (yet).
Did you try posting the same message in the mailing list? I will try to look into this and will let you know if I find an answer.

Comment by Kenny MacLeod

April 18, 2007 @ 4:07 pm

An alternative to the dwr namespace would be the more conventional Exporter-style pattern, as used by the Spring Remoting framework (see http://static.springframework.org/spring/docs/2.0.x/reference/remoting.html)

The allows a less direct coupling of DWR to the service being exported. To use a modified example from the above URL:

The advantages of this over the approach are:

- You can expose existing spring beans to DWR without modifying their definitions
- You can explicitly specify the interface of the bean you wish to expose
- No custom namespace required
- More conformant to the existing Spring remoting pattern

Comment by Kenny MacLeod

April 18, 2007 @ 4:10 pm

Nuts…. filtered out my XML:

<bean id=”accountService” class=”example.AccountServiceImpl”>
<!– any additional properties, maybe a DAO? –>
</bean>

<bean class=”org.directwebremoting.spring.DwrExporter”>
<property name=”serviceName” value=”AccountService”/>
<property name=”service” ref=”accountService”/>
<property name=”serviceInterface” value=”example.AccountService”/>
</bean>

Comment by Deha

May 8, 2007 @ 10:03 pm

Does DWR2.x and Spring2.x requires Java 5 environment?

Comment by Bram Smeets

May 9, 2007 @ 9:27 am

Spring has always been Java 1.3 compatible. As far as I know it is currently not required to use Java 5 to use DWR 2 and Spring 2.
Unless you use decide to use annotations, but the Spring support does not require it.

Pingback by MyÅ¡lenky dne otce Fura » Blog Archive » Není AJAX jako AJAX

May 19, 2007 @ 2:56 pm

[…] u vybrané beany oznaÄit elementem <dwr:remote …/>. Kompletní návod lze nalézt na blogu Bram Smeetse. Vývojáři DWR opravdu mysleli na nás ostatní vývojáře - POJO, kterých může být […]

Comment by Strykker

May 21, 2007 @ 2:09 pm

Is there a standard design pattern for combining the use DWR with regular MVC design using session stored state?

In my spring app am trying to keep a stateless service layer, which means for a web UI, I have all my state stored in the session. However, this means that the session state is obviously not available to the (client-side) DWR calls to my service layer.

It seems that since DWR calls all go through a controller or servlet, there is a possible hook-in there. I assume this must be a problem that many have encountered and I’m wondering if there’s an established, elegant or at least robust way of handling this.

Regards,
Eric

Comment by Strykker

May 22, 2007 @ 8:13 am

I am using spring with DWR, and my service layer uses abstract classes in some of its method parameters. Is there an easy way to handle DWR (inbound) marshaling for abstract class parameters or do I need to write a custom converter for each abstract class to tell DWR which concrete implementation to instantiate?

Comment by Bram Smeets

May 22, 2007 @ 9:32 am

Personally, I prefer using Spring’s scoping mechanism (available from Spring 2.0).

More information on the Spring scoping mechanism can be found here.

Comment by Bram Smeets

May 22, 2007 @ 9:43 am

For the second question: I’m afraid so :-(
But I am not quite sure, so please send a message to the DWR mailing list, just to make sure.

Comment by Strykker

May 22, 2007 @ 3:33 pm

Thanks for you response. WRT to using spring’s scoping mechanism: This means that you have a stateFUL service layer right? I assume that it is your service classes that are scoped to be session (or request) specific and are accessible to DWR.

I was actually implementing things that way and after some reading on the ‘benefits’ of a stateless service layer, decided to try and move to a stateless service layer and store all my state in the session (for a web app). I’m beginning to doubt the decision as spring’s ‘wiring’ means that the service layer is only loosely coupled to the webiness of the app (only coupled by configuration).

Any thoughts on this…

Regards,
Eric

Comment by Bram Smeets

May 22, 2007 @ 3:37 pm

No, sorry to give you the wrong impression. Using a stateless service layer is the way to go.

I always put a ‘layer’ in between, which consists of a facade. This facade is injected with the stateless service layer and I use the Spring scoping mechanism to keep the state per session, and etcetera.

Hope this helps….
Bram

Comment by Strykker

May 22, 2007 @ 4:35 pm

Thanks for the response,
But perhaps I’m missing something. If you do that (Ajax Facade) aren’t you just compounding your problem. Now you have this facade which will hold session state which can be accessed by DWR but needs to be managed carefully by any other component using the service layer (such as controllers or servlets) in order to make sure the state in the facade is synchronized. Either that or all components need to use the facade, and it’s really just a redundant service layer.

I have looked at the spring-one sample app which implements the design you are suggesting, except that the facade isn’t storing any state.

Also, In this case (without any state), why not remote the service classes (with proxied implementations) directly to DWR.

Eric

Comment by willmanja

May 22, 2007 @ 5:49 pm

Hi,

my question is how it work with spring mvc portlet,
how to use the controller in a portlet.

thanks

Comment by aris

June 19, 2007 @ 3:43 am

Hi,

Thanks for the article.
I have a question, what’s the use of ? Where it should be placed?
Because I did not see this in your article, just in some posts.

Or do I still need to declare this?

I’m getting errors using the SampleBean provided in your skeleton. The page is telling me that it’s not recognized. I have this defined in configuration-context.xml

dwrController
dwrController

Any advise is greatly appreciated.
Or if you have a working lightweight web-app I can use to pattern DWR and Spring integration.

Thanks!
Aris

Comment by RoadBugCz

June 27, 2007 @ 3:37 pm

Hi I have a question.
How do I set up a converter for a Custom Exception to be handled on the Client side by errorHandler. Did anybody succeeded in setting this up?
Any pointers would be appreciated.
Thanks a lot,
RoadBug

Comment by adam

July 2, 2007 @ 1:01 pm

If you want to map dwr to a /dwr/ subpath then basically its not easy. I’ve spent some time understanding this and noted my summary on the forum - http://forum.springframework.org/showthread.php?t=40841

Your best bet is to avoid mapping all requests to the dwr (/**/*) but map the elements that dwr needs:

dwrController
dwrController
dwrController
...these are optional - used in debug mode...

dwrController

dwrController

dwrController

If you already have these mapped, then check out the forum link for alternatives.

Comment by Buyle Guy

December 12, 2007 @ 6:27 pm

Hello,

I am just started with the integration of DWR with Spring. Is it possible to get the tse-demo.war file. So I can test it first with in Tomcat. Or could you please infrom me where I can download or where can I find the war file.

Thanks in advance,
Guy

Comment by Andrew Swan

January 3, 2008 @ 9:20 am

I downloaded your sample and got it to work, thanks! I notice the Spring XML file declares another XML namespace called “aop” that’s not mentioned in your blog entry. My test app seems to work fine without it; is there any special reason you included it in the sample?

FWIW, I’m using DwrSpringServlet.

Comment by Bram Smeets

January 3, 2008 @ 11:40 am

If it works without the aop namespace, then I guess it is not needed ;-)
The namespace is one of the Spring provided namespaces.

Comment by Joseph Glynn

January 18, 2008 @ 4:03 pm

One question:

Do I still need use the ServletWrappingController in my web.xml with the solution above if I want to use Spring Web MVC? Or do I use the standard spring dispatcher servlet.

Comment by sgan

January 23, 2008 @ 10:55 pm


I have one class derived from JPF plugin class, which is configured as spring bean, remoted via dwr with spring/dwr combined.

at runtime, when pulled from jsp page, everything works except there is this severe warning in the tomcat stdout.log:

SEVERE: No convertor found for No converter found for ‘org.java.plugin.registry.xml.PluginDescriptorImpl’

SEVERE: No converter found for ‘org.java.plugin.standard.StandardPluginManager’

when the components calling the java plugin decendent classes from javascript via dwr.

Is there someone that bumped into similar issue?

Comment by Olve

February 6, 2008 @ 11:54 am

Is it possible to use this approach combined with the traditional dwr.xml, or do I have to map the two to different urls? That is one /dwrtrad and /dwrspring ?

Pingback by Spring + DWR namespaces + AOP « developing developer

February 16, 2008 @ 9:38 am

[…] Spring, DWR and Ajax made easy […]

Trackback by House of Code

March 2, 2008 @ 12:52 am

DWR in a Jiffy…

Direct Web Remoting, or DWR in short, is a technology that helps you ease the development of javascript based applications using a Java server. What it does is simply sit in between your javascript and your java classes and acts as marshaller for metho…

Pingback by links for 2008-03-20 | .:: a few thoughts on the subject by rob wright ::.

March 20, 2008 @ 7:07 am

[…] Bram Smeets Blog » Spring & DWR - Ajax made Easy How to configure DWR in Spring 2.x (tags: dwr springframework) March 19th 2008 Posted to Links […]

Comment by Bram Smeets

March 29, 2008 @ 2:13 pm

Hi Joseph,
I would suggest using the DwrController, which can be used like any other Spring controller (so using it behind the Spring dispatcher servlet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>

 


You are viewing a mobilized version of this site...
View original page here

Mobilized by Mowser Mowser