Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Struts 2 »

[S2] AJAX with Sitemesh

Grish

2007-07-30

Replies:


I tried taking a modified version of the Struts 2 + Spring 2 + JPA + AJAX
tutorial that I've done and integrated it with Sitemesh.

I realized that if i have div tags with the ajax theme, Sitemesh will
decorate that area so I will end up with and embedded decorator in the main
page. I need to exclude my AJAX calls from being decorated. I understand
that Sitemesh has a decorators.xml where you can specify which urls are not
to be decorated:

<!-- Any urls that are excluded will never be decorated by Sitemesh -->
<excludes>
  <pattern>/styles/*</pattern>
  <pattern>/scripts/*</pattern>
  <pattern>/images/*</pattern>
  <pattern>/ajax/*</pattern>
  <pattern>/dojo/*</pattern>
  <pattern>/struts/*</pattern>
  <pattern>/nodecorate/*</pattern>
</excludes>

I first thought I simply had to move my jsps to a folder that was part of
the sitemesh excludes, like the ajax folder or the nodecorate folder. I have
a page called person.jsp and when I list the results of my search using ajax
I use the personList.jsp. I moved the personList.jsp to an excluded folder
but Sitemesh still decorated my personList.jsp.

I tried adding the namepspace to the excludes and it turned out that any
actions in that namesspace wasn't decorated, includeing person.jsp. I don't
want to seperate all my actions that are ajax calls into one namespace, so
is there a better way in implementing this? I have a feeling i'm approaching
this all wrong.

--
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

©2008 junlu.com - Jax Systems, LLC, U.S.A.