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—

<%@taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="sx" uri="/struts-dojo-tags"%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>

        JSP Page auto update

—struts.xml—
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd">      success.jsp  error.jsp       
—Update.java—
package actions;
import com.opensymphony.xwork2.ActionSupport;
/*** @author Abhishek
*/
public class Update extends ActionSupport{
@Override
    public String execute()

   {        System.out.println("1");
         return "success";
     }
}
  • can u please give me clear example for this

    • Hi Rajesh,
      Thanx for your comment. Please let me know what is not clear in this example?