tags:

views:

723

answers:

8

I've been a big of DWR (www.directwebremoting.org) in the past and have used it on a few projects. It makes AJAX easy by creating javascript proxy / stubs to java classes on the server.

While DWR has been around for years it seems to have slowed down ever since the main developer moved on - it's also quite large compared to it's early days.

As far as the need for a simply java to javascript proxying/marshelling (essentially abstract the lower level AJAX stuff) - can anyone recommend an alternative? All I have found is RAJAX but that is quite dated as well.

Thanks!!

A: 

jQuery is a more full-featured JavaScript library with AJAX support whereas DWR is more geared towards only AJAX rather than a complete JavaScript library.

Taylor Leese
jQuery isn't a replacement for DWR, since it doesn't have DWR's server components.
skaffman
I don't think you need DWR's server components. You can accomplish the same thing via other means.
Taylor Leese
I replaced dwr with jquery. This move simplified server components and view layer components.
serge_bg
Thanks for all the responses - but none of them answered my question. I'm specifically looking for a java to javascript proxy service. I'm not looking for a full UI javascript framework etc.
Not sure exactly what you mean by Java to JavaScript proxy, but have you looked into GWT?
Taylor Leese
+2  A: 

You can use jQuery for your Java Script interaction. With jQuery UI and the scores of jQuery plugins you can create powerful user interfaces.

That takes care of the front-end parts but you still need to get the server communication. In the simplest case you can use jQuery's getJSON method to fetch data from the server.

The server need to respond with something that looks like JSON. You can use something like JSON taglibs or JSON object models. In fact jQuery won't care where the JSON came from so a simple JSP (or servlet) would also do:

 <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="1.2">
 <jsp:directive.page contentType="text/json"/>
  {
     "firstName": "John",
     "lastName": "Smith",
     "address": {
         "streetAddress": "21 2nd Street",
         "city": "New York",
         "state": "NY",
         "postalCode": "10021"
     },
   }
 </jsp:root>

JSON is a good choice because it works easily with many JavaScript libraries and it doesn't tie you to any server side language/library/technology.

leonm
A: 

You can also take a look at Echo2 and OpenLazslo. GWT is also good. If you want something on a commercial perspective you can try ExtJS

Ram
A: 

Well by chance I found this http://jabsorb.org/ on a mailing list I was browsing for another reason. I haven't tried it yet - but the doc's seem to match what I'm after.

By the way - as far as the UI framework I'm using (in response to some of the other posts) I'm using http://www.qooxdoo.org/ which is fantastic.

A: 

yaml works with java and json in 3 to modernize dwr I too smoothly loosening xml towards more natural yaml

LarsOn
A: 

I've had a good deal of success marshaling my Java objects to XML using JiBX and afterwards translating the XML to JSON using Jettison. This process also works in reverse. Obviously, this doesn't proxy method calls and requires a bit of glue to get going. However, if DWR doesn't suit your needs and no other library seems appealing, rolling your own doesn't sound like such a bad idea either.

Max A.
A: 

StreamHub Reverse Ajax is very good but commercial if you need more than 20 users.

photographique
A: 

I'm using DWR for more than 3 years, I agree that there are no new development happening at DWR, But I feel DWR serves most of my needs like easy AJAX, Nice integration with Spring, Acegi, and Spring Security, Reverse AJAX, and Stable. So I don't see a reason to start looking for an alternative unless I needed something which is missing.

Intesar Mohammed