views:

40

answers:

1

I am using sitemesh defined jsp in decorator xml which needs to be refresh for every min. After refresh the page is duplicating header and footer.

I am using jQuery setInterval for refresh every min and given action name in load with div.

Can someone please help what are configuration changes I need to do for header footer not to duplicate.

I am using struts2, jQuery.

A: 

In your decorators.xml file you need to add some excludes like this:

  <excludes>        
    <pattern>/*ajax=true*</pattern>        
    <pattern>/scripts/jquery/*</pattern>
  </excludes> 

And so on for the things you do not want to decorate. So if I want to request a page that is not decorated with the above configuration I can tag on ajax=true or any other pattern that I configure to the end of the URL.

Lets say you have an action called dosomething.action that returns the content page that you do not want to decorate. Then instead of using the URL /dosomething.action I would call dosomething.action?ajax=true. This way sitemesh knows that this return should not be decorated.

Vincent Ramdhanie