auto update content ajax struts2 example

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

Versions that I have to 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″%>
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;

public class Update extends ActionSupport{
@Override
    public String execute()

   {        System.out.println("1");
         return "success";
     }
}