tags:

views:

255

answers:

1

I just started working on an application that is build on the Struts2 framework. I am coming from a .Net application with lot of Ajax features like dimming the rest of the site and show dialog box 'please wait while X is happening' ...auto complete and such other ajax features.

I searched google for Ajax plugins for Struts2 but did not find anything that looks like it would be worth it. Is my only option to use jquery and its plugins? Is this a pattern that some of you have seen also? Hopefully Java applications are not dead soon because of its inability to cope with ajax...compared to .Net

A: 

While I haven't worked with Struts2 in a while, I'm pretty certain it supports multiple Ajax options... I presume you looked at various Ajax the options in the Struts 2 documentation?

Depending on what you want to do, there's Ajax Tags which, although I haven't used it, I believe would be similar to the ASP.NET Ajax features. There's also the Dojo plugin, which again provided server side tags to bind to Dojo (javascript library) controls, but I've just noticed that its been deprectated...

If you are doing more complex/custom stuff, I've had good success with the JSON plugin, which lets you send JSON to the server & have it deserialised & bound directly to your actions & then serialise your results back to JSON for the response. This allows you to use jQuery (or your javascript library of choice) and talk to the server in both directions using JSON directly. Makes for a very clean & simple solution as the end result allows you to effectively use your business objects/data directly in your javascript code.

Alconja