ajax标签(Ajax Tags)
ajax标签(Ajax Tags)
Struts2 support for Ajax.
To use the Struts2 Ajax Tags, you need to do the following work:
1: the Dojo plugin, struts2-dojo-plugin-2.3.7.jar file is copied to the WEB-INF/lib folder.
2: the increase of taglib references on the page,
3: contains head tags at the top of each page
1) head tag
Function:
The head tag position is special, its function is to download
The Dojo file and the corresponding Javascript code,
So all the other using the Dojo tag page should contain the label.
Attribute:
Compressed: whether to use dojo.js compression version.
Debug: use the debug mode.
We suggest that during development, compressed is set to false,
Debug is set to true, so to facilitate the debugger;
But when delivered to the customer, compressed should be set to true,
Debug is set to false, it can speed up the operation of the program.
2) div tag:
Function:
The div tag display for Div element in HTML, but the div tag
Can be asynchronous, dynamic loading needs to display content,
But the div tag also provides an internal timer,
You can cycle in the set time to reload needs to display content.
Attribute:
Href: JSP or Action asynchronous request,
The action is responsible for the generation of the div element content.
UpdateFreq div: Specifies the update interval, the unit is MS, if you do not specify,
The div is updated only when a page loads the contents
Delay: Specifies the contents of the div update time delay, the unit is ms,
ShowLoadingText: whether to display the prompt loading information.
LoadingText: loading message
Indicator said: the picture shows that execution of asynchronous request
One example: page load, asynchronous access Action
ShowLoadingText= "true"
LoadingText= data is being loaded. ".."
ErrorText= failed to load data. ".."
Indicator= "indicator"
>
Returns the Ajax result