AjaxStruts
This page is for anyone looking for information on using the Ajax (Asynchronous Javascript + XML) methodology, specifically of course within the Struts domain.
It is my hope that people will add different implementations that they come up with so that others can see how this powerful technique can be applied. If you use Ajax in a project in a neat way, please feel free to post what you did here!
To get things started, I have written an article and a fairly interesting (I think so!) example web app. Here is the relevant link:
url: http://www.omnytex.com/articles
The article gives some good introductory-level info on using the XMLHttpRequest object and explains a few bits of the sample web app.
The sample web app shows six different usages of the object, including dynamic sorting of a table, dynamic updating of a <select> element, dynamic loading of a <textarea> and an RSS feed parser (two versions in fact!).
Hope this is useful to someone!
I have also written a taglib that allows you to quickly and easily add Ajax functionality to a JSP with NO coding on your part (it's all declarative, just like Struts)... there originally was a Strtus-only version (an extended version of the HTML taglib) which is still available on the Struts Apps Sourceforge page. However, that version is no longer being developed and has been superceeded by the Ajax Tags sub-component of the Java Web Parts project (url: http://javawebparts.sourceforge.net). This version of the taglib, which is very similar to the original Struts-only version, is not tied to Struts at all and has a little more flexibility out-of-the-box.
Thanks to James Garnett at Adaptive Path for these pics, url: http://www.adaptivepath.com/publications/essays/archives/000385.php
It is worth noting that AJAX is not a specific technology implementation, it is an approach, a technique, a way of looking at things. While it is true that the use of XMLHttpRequest sending and receiving XML is the generally accepted way to do AJAX-like things, it is not the only way. While the above diagrams are accurate, they do not reflect this. No one should be under the impression that you have to deal in XML or that you have to use the XMLHttpRequest object at all, contrary to the meaning of the AJAX moniker (one could argue it isn't called AJAX at that point, but that is a debate for another day!)
댓글 없음:
댓글 쓰기