SiteMesh is just a decorator and not Struts 2 centric so you won't find what 
you want in its native configuration.? As far as it is concerned the view could 
have been generated by a CGI script of anything. I think the path of least 
effort it to have two essentially blank JSps that include the actual material 
you want to re-use? 
Chris



 


 

-----Original Message-----
From: CS Wong <lilw...@gmail.com>
To: user@struts.apache.org
Sent: Tue, Aug 11, 2009 6:10 am
Subject: Configuring SiteMesh for specific action mappings in Struts 2?










Hi,
I'm trying to configure sitemesh to only take effect for a certain subset of
action mappings in my Struts 2 application.

Say for example, I have the following struts.xml snippet:

<package name="default" namespace="/" extends="struts-default">
  <action name="showForm">
    <result>/view/form.jsp</result>
  </action>
</package>
<package name="widgets" namespace="/widgets" extends="struts-default">
  <action name="showForm">
    <result>/view/form.jsp</result>
  </action>
</package>

I would like the output of "/showForm.action" to be decorated by SiteMesh
but for "/widgets/showForm.action" to be returned empty instead. The
critical part here is that I want the JSP file to be reused by both action
mappings.

But try as I might, I can't seem to get SiteMesh's <exclude/> tag to
recognize a mapping. I have to specify the file "/view/form.jsp" to be
excluded instead and that means I won't be able to reuse the JSP file.

Is there any way I can get around this?

I'm using Struts 2.0.14.

Thanks,
Wong



 

Reply via email to