Alternatives to DWR (www.directwebremoting.org) [closed]
Asked Answered
E

8

14

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!!

Extinction answered 19/9, 2009 at 5:33 Comment(1)
I always loved DWR. Currently I am looking for the best and well supported option to validate form input DWR-Style. Did you develop a preference after all these years since posting this? I am surprised I don't see an actual Spring solution.Nicol
M
7

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.

Mesquite answered 12/10, 2010 at 21:35 Comment(1)
Yes, but does the latest DWR work with hibernate 5.3? I have to upgrade a DWR project from hib 3 to 5.3 and am having troubles getting DWR to work with Spring 5/Hibernate 5.3.Lurette
S
3

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.

Sherri answered 19/9, 2009 at 8:8 Comment(1)
And what about text escaping? If I read strings from beans how can I avoid to write back to browser bad JSON? I'm thinking about strings that contains " and /n . Is the jsp:getProperty tag doing that work for you?Eastwood
E
3

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.

Extinction answered 19/9, 2009 at 22:49 Comment(0)
H
1

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.

Haik answered 21/9, 2009 at 1:18 Comment(0)
E
1

I use jQuery on client side and Jersey on server side. They let you free to use xml, json or both.

Eastwood answered 19/2, 2013 at 8:24 Comment(0)
S
0

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

Splashdown answered 19/9, 2009 at 10:51 Comment(0)
R
0

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

Rodi answered 20/9, 2009 at 10:31 Comment(0)
H
0

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

Hick answered 1/10, 2009 at 1:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.