You did understand me correctly and I see your dilema -- problem is the tags 
like <exclude> are
not aware of what action the view came from :(



 

-----Original Message-----
From: CS Wong <lilw...@gmail.com>
To: Struts Users Mailing List <user@struts.apache.org>
Sent: Tue, Aug 11, 2009 1:03 pm
Subject: Re: Configuring SiteMesh for specific action mappings in Struts 2?










If I understand you correctly, you're saying that I should have double
copies of each JSP, say "/decorated/view.jsp" and "/undecorated/view.jsp".
And I should configure the exclusion pattern like
"<exclude>/undecorated/*</exclude>".
If possible, I'd really like to avoid that. Java classes themselves already
have plenty of boilerplate code without adding JSPs to the mix :)


On Tue, Aug 11, 2009 at 10:55 PM, <musom...@aol.com> wrote:

>
>  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