The Ajax Ajaxtags project is based on the existing struts HTML tag library, adding AJAX support. Ajaxtags rewrote the Struts tag class Org.apache.struts.taglib.html.FormTag and Org.apache.struts.taglib.html.BaseHandlerTag, and uses Struts's plugin technology , enabling struts to provide support for Ajax. The following are simple examples in a JSP:
Name:
Last Name:
Result:
Note: The Ajaxref property. The contents of the Ajaxref property are defined in Ajax-config.xml, for example, the configuration section of this example is as follows:
! DOCTYPE ajaxconfig Public "Ajaxconfig" "Ajaxconfig"
!--Define A custom request handler that generates XML for example 2-->
Customgeneratexml
Customxmlgenerator.js
!--Configuration for example 1-->
example1.do
Firstname=firstname,lastname=lastname
Example1_resultlayer
The properties of the form are defined in the configuration file, as well as the events that are triggered by the button and how the writeback results are handled. The Ajax invocation of struts is implemented with a clever encapsulation method. Of course ajaxtags is a relatively long distance away from the practical phase, but it provides a feasible solution for efficient development of AJAX applications on existing software architectures.