Most commonly used AJAX library with Struts 2?

I need to integrate AJAX functionality into the Struts 2 web application. I learned some lessons and was going to try using the Dojo plugin, but quickly realized that it was deprecated from Struts 2.1.

The AJAX documentation for Struts 2 provides many potential solutions, and I'm trying to narrow it down a bit.

I understand that this question is a bit general, and there are some questions that exist here about certain alternatives, but I would like to feel in the community regarding what is the most commonly used approach.

I am also interested in whether using one of the AJAX taglib plugins (i.e. struts2-jquery ) or direct AJAX widgets regardless of Struts is more common.

I understand the basic concepts of AJAX, but do not have much practical experience with any of the libraries. I do not mind to get up at some point, to accelerate something, if necessary.

Thanks so much for any suggestions!

+4
source share
2 answers

I would recommend doing it manually through some JS library, and they will go to the taglib plugin as soon as you realize that the plugin is abstracting for you. I think that gaining practical experience with libraries is a more effective investment in education / training. This way, when you move to a different web structure, you can better understand the side of the JavaScript API.

jQuery is probably your best bet, so you can go to the struts2-jquery plugin if you decide it's worth it. The Javascript Struts 2 plugin is actively supported (although there are several versions on jquery / jquery-ui) , and I have friends who use it quite happily, However, I personally tend to stick with direct jQuery ajax calls for Struts 2 actions that return fragments JSON or FreeMarker for autocompletion, updating search results, etc.

+3
source

Use all the JS framework you want and don’t worry about the plugin if it does not give you good reason to use it.

If you haven't used the JS framework before and are looking for suggestions, I would recommend jQuery .

+3
source

All Articles