I¹m certain that¹s not correct. We use the decorators.xml file extensively
and we¹re able to have pretty fine control over the sitemesh decorators. I
know in our installation the decorator is based on the action url rather
than the resulting jsp file.

For example you could include a excludes pattern which ignores all widget
requests by placing
<pattern>/widgets/*</pattern> in your excludes section.

Z.
> 
> 
> Tried this route but it seems to me that they only work if the patterns
> specified point to physical files only. For example, it'd work if it points
> to "index.html" or "/view/hello.jsp".
> However, I was assuming that it would work for the output from the filter
> dispatcher as well. What I wanted to achieve was to have SiteMesh invoked
> for the output from "/hello.action" but to be excluded for
> "/widgets/hello.action".
> 
> Big picture-wise, what I wanted was to have one default Struts 2 package,
> all configured to serve full pages decorated by SiteMesh. Then I'll create
> another package "widgets", where there's no decorator invoked and it only
> serves the raw content of the JSPs returned. On my pages, if AJAX is
> available, I'd dynamically change the links to load from the "widgets"
> package instead so I can just call the widget and render it dynamically into
> the page using JS. I'd be able to reuse both the action classes and the JSP
> throughout both packages then.
> 
> BTW, I know that SiteMesh is not a native Struts 2 application so if enough
> people think I'm off-topic here please do let me know. I just thought that
> since SiteMesh is a supported plugin, it may be applicable here.
> 
> Thanks,
> Wong
> 
> 
> On Tue, Aug 11, 2009 at 8:42 PM, Eduard Neuwirt <
> eduard.neuw...@googlemail.com> wrote:
> 
>> > Hi Wong,
>> >
>> > perhaps would the following entries from decorators.xml help you :
>> >
>> > <decorators defaultdir="/jsp/decorators">
>> >  <excludes>
>> >   <pattern>/styles/*</pattern>
>> >   <pattern>/scripts/*</pattern>
>> >   <pattern>/images/*</pattern>
>> >   <pattern>/index.html</pattern>
>> >  </excludes>
>> > ...
>> > </decorators>
>> >
>> > Regards
>> > Eduard Neuwirt
>> >
>> > CS Wong schrieb:
>> >
>> >  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
>>> >>
>>> >>
>>> >>
>> >
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> > For additional commands, e-mail: user-h...@struts.apache.org
>> >
>> >

Reply via email to