auto update content ajax struts2 example

There may be a requirement to update some content in web application . I have done this in struts2 and ajax (dojo plugin). I have try many websites but found example that not worked then i have spent time to do this and the following example develops.

Versions that i have use:
Struts2 2.2.3
struts2-dojo-plugin-2.1.8.1.jar

—one.jsp—

—struts.xml—

—Update.java—

struts2 and Dojo

A definition form http://dojotoolkit.org:-
Dojo is a collection of JavaScript utilities providing solutions for a vast array of problems faced by the professional JavaScript developer. Dojo Base is the foundation of the Dojo Toolkit and functionality such as DOM and AJAX convenience methods, animations, and other base functionality suitable for building simple Web sites. Dojo Core is a larger set of components built upon Dojo Base and includes things such as drag and drop, l10n and i18n components, and data stores. Dijit is a complete widget system, providing all core UI components and utilities, andDojoX is a collection of advanced components, including data grids, low-level graphics libraries, mobile components, and other experimental software. Finally, the Utilities section provides extensive information about theDojo Build systemDojo Module Loader, and a variety of other Dojo-related utilities.

Dojo toolkit is very use for those who  don’t want to work with JavaScript . As I am not good in JavaScript that is why i am seeking for some thing different. then i came to know about Dojo here is the simple example that i have done in struts2 and Dojo by using Dojo plugin. for this your have to first download the dojo plugin and put it in the libraries of your project .

Step-1 Download dojo plugin
http://repo1.maven.org/maven2/org/apache/struts/struts2-dojo-plugin/2.1.8.1/struts2-dojo-plugin-2.1.8.1.jar

Step-2
Now right click on the libraries in your struts2 project > Add Jar/folder > now give the location of the dojo plugin that you have just downloaded > select dojo plugin > cilck ok.

Step-3 
copy and paste the following files

—index.jsp—

—-my.jsp—

—Action.java—

—result.jsp—

—struts.xml—

NOTE – It is recommended that you should use jQuery with Struts2 rather than dojo. Dojo is very rich and make the work easy but the use of Dojo with struts2 will be deprecated .