AJAX-Framework

What Ajax framework / toolkit can you recommend for creating GUIs for web applications using struts?

+4
source share
5 answers

I would say that your choice of AJAX / javascript library should depend less on how your backend is implemented and what your user interface will be like.

If your site will mainly be static web pages with some AJAX, then it is better to use a lighter javascript structure like jquery . But if you are creating a user interface more than a web application where the user remains on one page for a long time (think gmail, Google Calendar, etc.), then it is probably best to look at Dojo , ExtJs or GWT .

+1
source

I suggest a jQuery UI plugin.

jQuery , prototype , Yahoo! The user interface , MooTools , dojo and ExtJS will work with very strong code. Other features that I cannot vouch for: QooxDoo

+1
source

Struts already ships with the Dojo framework. You can customize the application theme on ajax and you can use it.

Look at the struts.ui.theme property in the struts.properties file!

Good article for you - this one in JavaWorld

0
source

I would go with ExtJS ( http://extjs.com/ ). It has a very good model of components and events and very good support. This is AJAX best;)

You can use the JSON response actions to provide data to the Ext external interface. You do not even need to mix the client interface with the server interface (via JSPX / tags).

Some see that you need to develop a client interface that is separate from the server interface as an Ext flaw. I think this is not the case, as I switched web applications built from Ext from the java server to the .Net backend without changing the line of the client interface code, be it HTML or Javascript.

Take a look at the examples and Ext documents before you decide.

0
source

This has already been mentioned, but I will say it again: jQuery. The power of jQuery is not just the ability to make a simple AJAX call or a large library of UI extensions. In my humble opinion, the best part of jQuery is how you can easily handle the returned data. jQuery easily allows you to navigate XML just like HTML.

For example, let's say you get an xml request:

(: Borrowed this XML from the MarkLogic training file :)

<author name="Boynton"> <book> <title>Barnyard Dance!</title> <year>1993</year> </book> <book> <title>Hippos Go Berserk!</title> <year>1996</year> </book> </author> 

jQuery can retrieve all the elements of the year with this simple command:

 var years = $("year"); //Ok, lets act on each element instead $("year").each(function(index, value){ alert("Element " + index + " = " + value); }); /* OUTPUT Element 0 = 1993 Element 1 = 1996 /* 

Try to do it in plain Javascript!

In addition, the jQuery method is designed just beautifully. Founders encourage the extension of the structure by adding the ability to create extensions to the core of the library (of course, you can always simply edit the Javascript file, but what happens when a critical update for the framework).

Another big reason to use jQuery is its compatibility with other Javascript frameworks. By default, both Prototype and jQuery use the $ sign to refer to the main library object. Only jQuery adds functions to remove this link so that it can coexist with Prototype.

jQuery makes JavaScript nice.

0
source

Source: https://habr.com/ru/post/1277361/


All Articles