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


<%@taglib prefix=”s” uri=”/struts-tags” %>
<%@ taglib prefix=”sx” uri=”/struts-dojo-tags”%>
<%@page contentType=”text/html” pageEncoding=”UTF-8″%>
auto update


“-//Apache Software Foundation//DTD Struts Configuration 2.0//EN” “”>      success.jsp  error.jsp       


package actions;
import com.opensymphony.xwork2.ActionSupport;

public class Update extends ActionSupport{
    public String execute()

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