You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Philipp Leusmann <ph...@rwth-aachen.de> on 2010/01/21 17:39:17 UTC

decorating static content with sitemesh

Hi,

I am using the sitemesh-plugin to decorate my struts-site and Im am wondering, if it is possible to decorate static-pages using sitemesh.
That is, I have some plain html pages which need to get the same LAF the entire site has.
I already added "<pattern>/html/*</pattern>" to the decorators.xml, but all I get is an Exception when trying to open the page:

java.lang.RuntimeException: javax.servlet.ServletException: Error applying decorator: null
	com.opensymphony.sitemesh.webapp.decorator.BaseWebAppDecorator.render(BaseWebAppDecorator.java:39)
	com.opensymphony.sitemesh.webapp.SiteMeshFilter.doFilter(SiteMeshFilter.java:84)
	org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter.doFilter(StrutsPrepareFilter.java:82)


The Exception is raised by a NullPointerException in org.apache.struts2.sitemesh.OldDecorator2NewStrutsDecorator.render(Content, HttpServletRequest, HttpServletResponse, ServletContext, SiteMeshWebAppContext) by 
ValueStack vs = Dispatcher.getInstance().getContainer().getInstance(ValueStackFactory.class).createValueStack(); 

"Dispatcher.getInstance()" returns null

FYI, I am using the sitemesh-2.4.2 hotfix from jira

Now, is this behaviour only a bug, or is it not meant to be used with static content?

To find out by myself, I was desperately trying to compile struts2 and xwork from svn, but it continously failed and I gave up. (Maybe this is why the last nightly build is from 6 days ago?)

Hope somebody can help.

Regards,
 Philipp

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: decorating static content with sitemesh

Posted by "Kawczynski, David" <da...@merck.com>.
How do you have struts mapped in web.xml?  If it is mapped to /*
no you don't.  If it is mapped to *.action, add another mapping 
for /staticHTML/* 


> -----Original Message-----
> From: Philipp Leusmann [mailto:philipp.leusmann@rwth-aachen.de] 
> Sent: Thursday, January 21, 2010 2:42 PM
> To: Struts Users Mailing List
> Subject: Re: decorating static content with sitemesh
> 
> Hi Brian,
> 
> that would work, but then I'll have to make a call to 
> "/staticHTML/page.html.action" to access "/staticHTML/page.html". 
> Would be a workaround, but I still would prefer the call to *.html
> 
> Philipp
> 
> Am 21.01.2010 um 19:18 schrieb Brian Thompson:
> 
> > Can you get the Struts filter to execute for static pages?  
> It seems like
> > that would fix the Dispatcher.getInstance() problem.  Something like
> > 
> > <action name="*" class="com.opensymphony.xwork2.ActionSupport">
> >  <result name="success">/staticHTML/{1}</result>
> > </action>
> > 
> > in your struts.xml seems like it would do the trick (be careful of
> > overriding your regular actions!).
> > 
> > -Brian
> > 
> > 
> > 
> > On Thu, Jan 21, 2010 at 11:49 AM, Philipp Leusmann <
> > philipp.leusmann@rwth-aachen.de> wrote:
> > 
> >> Sure it would be faster without that stuff, but since I use some
> >> session-related stuff (user login status etc.) , replacing 
> it with a static
> >> decorator would not be feasible.
> >> 
> >> Thanks anyway for your suggestions.
> >> 
> >> Regards,
> >> Philipp
> >> <snip>
> >> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
Notice:  This e-mail message, together with any attachments, contains information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), and/or its affiliates Direct contact information for affiliates is available at http://www.merck.com/contact/contacts.html) that may be confidential, proprietary copyrighted and/or legally privileged. It is intended solely for the use of the individual or entity named on this message. If you are not the intended recipient, and have received this message in error, please notify us immediately by reply e-mail and then delete it from your system.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: decorating static content with sitemesh

Posted by Philipp Leusmann <ph...@rwth-aachen.de>.
Just to add things up, I filed a jira-issue for all of this: <https://issues.apache.org/jira/browse/WW-3381> , but maybe you can still convince me I got things wrong and the stuff works without jumping hoops


Am 03.02.2010 um 12:54 schrieb Philipp Leusmann:

> Sorry for my late reply, but I was busy doing other things.
> 
> I just investigated a little further into this issue, but still cannot find a way to resolve it.
> As you proposed, I checked my struts filter mapping, which is /* , so that would be sufficient. 
> 
> I also checked the struts.action.extension-property in struts.properties, which I commented out, so this defaults to "action" and "" in org.apache.struts2.dispatcher.mapper.DefaultActionMapper.
> But in this class there seems to be the error: In revision 615679 a change was made to org.apache.struts2.dispatcher.mapper.DefaultActionMapper.dropExtension(String, ActionMapping) , which was supposed to add some special handling for urls like /foo/bar-1.0/description . Anyway, this handling seems to breaks URLs like "foo.htm".
> 
> So, to sum it up, am I missing anything which I need to do to make my stuff work? If not, I'll subclass the DefaultActionMapper and override the mentioned method, but I don't think thats the way it's supposed to be.
> 
> Regards,
> Philipp
> 
> 
> Am 21.01.2010 um 20:47 schrieb Brian Thompson:
> 
>> In web.xml, make a Struts filter mapping that includes *.html in addition to
>> *.action.
>> 
>> -Brian
>> 
>> 
>> On Thu, Jan 21, 2010 at 1:41 PM, Philipp Leusmann <
>> philipp.leusmann@rwth-aachen.de> wrote:
>> 
>>> Hi Brian,
>>> 
>>> that would work, but then I'll have to make a call to
>>> "/staticHTML/page.html.action" to access "/staticHTML/page.html".
>>> Would be a workaround, but I still would prefer the call to *.html
>>> 
>>> Philipp
>>> 
>>> Am 21.01.2010 um 19:18 schrieb Brian Thompson:
>>> 
>>>> Can you get the Struts filter to execute for static pages?  It seems like
>>>> that would fix the Dispatcher.getInstance() problem.  Something like
>>>> 
>>>> <action name="*" class="com.opensymphony.xwork2.ActionSupport">
>>>> <result name="success">/staticHTML/{1}</result>
>>>> </action>
>>>> 
>>>> in your struts.xml seems like it would do the trick (be careful of
>>>> overriding your regular actions!).
>>>> 
>>>> -Brian
>>>> 
>>>> 
>>>> 
>>>> On Thu, Jan 21, 2010 at 11:49 AM, Philipp Leusmann <
>>>> philipp.leusmann@rwth-aachen.de> wrote:
>>>> 
>>>>> Sure it would be faster without that stuff, but since I use some
>>>>> session-related stuff (user login status etc.) , replacing it with a
>>> static
>>>>> decorator would not be feasible.
>>>>> 
>>>>> Thanks anyway for your suggestions.
>>>>> 
>>>>> Regards,
>>>>> Philipp
>>>>> <snip>
>>>>> 
>>> 
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>> 
>>> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: decorating static content with sitemesh

Posted by Philipp Leusmann <ph...@rwth-aachen.de>.
Sorry for my late reply, but I was busy doing other things.

I just investigated a little further into this issue, but still cannot find a way to resolve it.
As you proposed, I checked my struts filter mapping, which is /* , so that would be sufficient. 

I also checked the struts.action.extension-property in struts.properties, which I commented out, so this defaults to "action" and "" in org.apache.struts2.dispatcher.mapper.DefaultActionMapper.
But in this class there seems to be the error: In revision 615679 a change was made to org.apache.struts2.dispatcher.mapper.DefaultActionMapper.dropExtension(String, ActionMapping) , which was supposed to add some special handling for urls like /foo/bar-1.0/description . Anyway, this handling seems to breaks URLs like "foo.htm".

So, to sum it up, am I missing anything which I need to do to make my stuff work? If not, I'll subclass the DefaultActionMapper and override the mentioned method, but I don't think thats the way it's supposed to be.

Regards,
 Philipp


Am 21.01.2010 um 20:47 schrieb Brian Thompson:

> In web.xml, make a Struts filter mapping that includes *.html in addition to
> *.action.
> 
> -Brian
> 
> 
> On Thu, Jan 21, 2010 at 1:41 PM, Philipp Leusmann <
> philipp.leusmann@rwth-aachen.de> wrote:
> 
>> Hi Brian,
>> 
>> that would work, but then I'll have to make a call to
>> "/staticHTML/page.html.action" to access "/staticHTML/page.html".
>> Would be a workaround, but I still would prefer the call to *.html
>> 
>> Philipp
>> 
>> Am 21.01.2010 um 19:18 schrieb Brian Thompson:
>> 
>>> Can you get the Struts filter to execute for static pages?  It seems like
>>> that would fix the Dispatcher.getInstance() problem.  Something like
>>> 
>>> <action name="*" class="com.opensymphony.xwork2.ActionSupport">
>>> <result name="success">/staticHTML/{1}</result>
>>> </action>
>>> 
>>> in your struts.xml seems like it would do the trick (be careful of
>>> overriding your regular actions!).
>>> 
>>> -Brian
>>> 
>>> 
>>> 
>>> On Thu, Jan 21, 2010 at 11:49 AM, Philipp Leusmann <
>>> philipp.leusmann@rwth-aachen.de> wrote:
>>> 
>>>> Sure it would be faster without that stuff, but since I use some
>>>> session-related stuff (user login status etc.) , replacing it with a
>> static
>>>> decorator would not be feasible.
>>>> 
>>>> Thanks anyway for your suggestions.
>>>> 
>>>> Regards,
>>>> Philipp
>>>> <snip>
>>>> 
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>> 
>> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: decorating static content with sitemesh

Posted by Brian Thompson <el...@gmail.com>.
In web.xml, make a Struts filter mapping that includes *.html in addition to
*.action.

-Brian


On Thu, Jan 21, 2010 at 1:41 PM, Philipp Leusmann <
philipp.leusmann@rwth-aachen.de> wrote:

> Hi Brian,
>
> that would work, but then I'll have to make a call to
> "/staticHTML/page.html.action" to access "/staticHTML/page.html".
> Would be a workaround, but I still would prefer the call to *.html
>
> Philipp
>
> Am 21.01.2010 um 19:18 schrieb Brian Thompson:
>
> > Can you get the Struts filter to execute for static pages?  It seems like
> > that would fix the Dispatcher.getInstance() problem.  Something like
> >
> > <action name="*" class="com.opensymphony.xwork2.ActionSupport">
> >  <result name="success">/staticHTML/{1}</result>
> > </action>
> >
> > in your struts.xml seems like it would do the trick (be careful of
> > overriding your regular actions!).
> >
> > -Brian
> >
> >
> >
> > On Thu, Jan 21, 2010 at 11:49 AM, Philipp Leusmann <
> > philipp.leusmann@rwth-aachen.de> wrote:
> >
> >> Sure it would be faster without that stuff, but since I use some
> >> session-related stuff (user login status etc.) , replacing it with a
> static
> >> decorator would not be feasible.
> >>
> >> Thanks anyway for your suggestions.
> >>
> >> Regards,
> >> Philipp
> >> <snip>
> >>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: decorating static content with sitemesh

Posted by Philipp Leusmann <ph...@rwth-aachen.de>.
Hi Brian,

that would work, but then I'll have to make a call to "/staticHTML/page.html.action" to access "/staticHTML/page.html". 
Would be a workaround, but I still would prefer the call to *.html

Philipp

Am 21.01.2010 um 19:18 schrieb Brian Thompson:

> Can you get the Struts filter to execute for static pages?  It seems like
> that would fix the Dispatcher.getInstance() problem.  Something like
> 
> <action name="*" class="com.opensymphony.xwork2.ActionSupport">
>  <result name="success">/staticHTML/{1}</result>
> </action>
> 
> in your struts.xml seems like it would do the trick (be careful of
> overriding your regular actions!).
> 
> -Brian
> 
> 
> 
> On Thu, Jan 21, 2010 at 11:49 AM, Philipp Leusmann <
> philipp.leusmann@rwth-aachen.de> wrote:
> 
>> Sure it would be faster without that stuff, but since I use some
>> session-related stuff (user login status etc.) , replacing it with a static
>> decorator would not be feasible.
>> 
>> Thanks anyway for your suggestions.
>> 
>> Regards,
>> Philipp
>> <snip>
>> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: decorating static content with sitemesh

Posted by Brian Thompson <el...@gmail.com>.
Can you get the Struts filter to execute for static pages?  It seems like
that would fix the Dispatcher.getInstance() problem.  Something like

<action name="*" class="com.opensymphony.xwork2.ActionSupport">
  <result name="success">/staticHTML/{1}</result>
</action>

in your struts.xml seems like it would do the trick (be careful of
overriding your regular actions!).

-Brian



On Thu, Jan 21, 2010 at 11:49 AM, Philipp Leusmann <
philipp.leusmann@rwth-aachen.de> wrote:

> Sure it would be faster without that stuff, but since I use some
> session-related stuff (user login status etc.) , replacing it with a static
> decorator would not be feasible.
>
> Thanks anyway for your suggestions.
>
> Regards,
>  Philipp
> <snip>
>

Re: decorating static content with sitemesh

Posted by Philipp Leusmann <ph...@rwth-aachen.de>.
Sure it would be faster without that stuff, but since I use some session-related stuff (user login status etc.) , replacing it with a static decorator would not be feasible.

Thanks anyway for your suggestions.

Regards,
 Philipp

Am 21.01.2010 um 18:37 schrieb Kawczynski, David:

> I have used struts tags in my decorating templates (past tense).
> It is definitely possible... but not smart, IMHO.  
> Why?  Response times, especially under load + time, were horrible.
> 
> I countered this by removing the struts tags from my templates, 
> re-arranging the filters in web.xml, and configuring SiteMesh to 
> use different decorator templates for different paths.  (Note that
> this works when template content varies based on navigation path, not
> on user attributes or something similar.)  Response times were much 
> snappier after doing this.
> 
> 
> 
>> -----Original Message-----
>> From: Philipp Leusmann [mailto:philipp.leusmann@rwth-aachen.de] 
>> Sent: Thursday, January 21, 2010 12:26 PM
>> To: Struts Users Mailing List
>> Subject: Re: decorating static content with sitemesh
>> 
>> Ok, that would not be sufficient for me, since I use some 
>> struts in my decorating template, as well.
>> 
>> I thought, maybe struts and sitemesh could decorate static 
>> pages using the default action to resolve the stack
>> 
>> Philipp
>> 
>> Am 21.01.2010 um 18:01 schrieb Kawczynski, David:
>> 
>>> Plain sitemesh, with it's own filter in web.xml 
>>> 
>>>> -----Original Message-----
>>>> From: Philipp Leusmann [mailto:philipp.leusmann@rwth-aachen.de] 
>>>> Sent: Thursday, January 21, 2010 11:58 AM
>>>> To: Struts Users Mailing List
>>>> Subject: Re: decorating static content with sitemesh
>>>> 
>>>> David,
>>>> 
>>>> did you use plain sitemesh or the struts-sitemesh plugin?
>>>> 
>>>> Philipp
>>>> 
>>>> Am 21.01.2010 um 17:50 schrieb Kawczynski, David:
>>>> 
>>>>> I have used SiteMesh to decorate static content served
>>>>> up by the app server.  If the static content is served
>>>>> up by apache (or some other httpd server) you're out of
>>>>> luck.  
>>>>> 
>>>>>> -----Original Message-----
>>>>>> From: Philipp Leusmann [mailto:philipp.leusmann@rwth-aachen.de] 
>>>>>> Sent: Thursday, January 21, 2010 11:39 AM
>>>>>> To: Struts Users Mailing List
>>>>>> Subject: decorating static content with sitemesh
>>>>>> 
>>>>>> Hi,
>>>>>> 
>>>>>> I am using the sitemesh-plugin to decorate my struts-site and 
>>>>>> Im am wondering, if it is possible to decorate static-pages 
>>>>>> using sitemesh.
>>>>>> That is, I have some plain html pages which need to get the 
>>>>>> same LAF the entire site has.
>>>>>> I already added "<pattern>/html/*</pattern>" to the 
>>>>>> decorators.xml, but all I get is an Exception when trying to 
>>>>>> open the page:
>>>>>> 
>>>>>> java.lang.RuntimeException: javax.servlet.ServletException: 
>>>>>> Error applying decorator: null
>>>>>> 	
>>>>>> com.opensymphony.sitemesh.webapp.decorator.BaseWebAppDecorator
>>>>>> .render(BaseWebAppDecorator.java:39)
>>>>>> 	
>>>>>> com.opensymphony.sitemesh.webapp.SiteMeshFilter.doFilter(SiteM
>>>>>> eshFilter.java:84)
>>>>>> 	
>>>>>> org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter.do
>>>>>> Filter(StrutsPrepareFilter.java:82)
>>>>>> 
>>>>>> 
>>>>>> The Exception is raised by a NullPointerException in 
>>>>>> org.apache.struts2.sitemesh.OldDecorator2NewStrutsDecorator.re
>>>>>> nder(Content, HttpServletRequest, HttpServletResponse, 
>>>>>> ServletContext, SiteMeshWebAppContext) by 
>>>>>> ValueStack vs = 
>>>>>> Dispatcher.getInstance().getContainer().getInstance(ValueStack
>>>>>> Factory.class).createValueStack(); 
>>>>>> 
>>>>>> "Dispatcher.getInstance()" returns null
>>>>>> 
>>>>>> FYI, I am using the sitemesh-2.4.2 hotfix from jira
>>>>>> 
>>>>>> Now, is this behaviour only a bug, or is it not meant to be 
>>>>>> used with static content?
>>>>>> 
>>>>>> To find out by myself, I was desperately trying to compile 
>>>>>> struts2 and xwork from svn, but it continously failed and I 
>>>>>> gave up. (Maybe this is why the last nightly build is from 6 
>>>>>> days ago?)
>>>>>> 
>>>>>> Hope somebody can help.
>>>>>> 
>>>>>> Regards,
>>>>>> Philipp
>>>>>> 
>>>>>> 
>>>> 
>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>>>> For additional commands, e-mail: user-help@struts.apache.org
>>>>>> 
>>>>>> 
>>>>> Notice:  This e-mail message, together with any 
>>>> attachments, contains information of Merck & Co., Inc. (One 
>>>> Merck Drive, Whitehouse Station, New Jersey, USA 08889), 
>>>> and/or its affiliates Direct contact information for 
>>>> affiliates is available at 
>>>> http://www.merck.com/contact/contacts.html) that may be 
>>>> confidential, proprietary copyrighted and/or legally 
>>>> privileged. It is intended solely for the use of the 
>>>> individual or entity named on this message. If you are not 
>>>> the intended recipient, and have received this message in 
>>>> error, please notify us immediately by reply e-mail and then 
>>>> delete it from your system.
>>>>> 
>>>>> 
>>>>> 
>>>> 
>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>>> For additional commands, e-mail: user-help@struts.apache.org
>>>>> 
>>>> 
>>>> 
>>>> 
>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>> For additional commands, e-mail: user-help@struts.apache.org
>>>> 
>>>> 
>>> Notice:  This e-mail message, together with any 
>> attachments, contains information of Merck & Co., Inc. (One 
>> Merck Drive, Whitehouse Station, New Jersey, USA 08889), 
>> and/or its affiliates Direct contact information for 
>> affiliates is available at 
>> http://www.merck.com/contact/contacts.html) that may be 
>> confidential, proprietary copyrighted and/or legally 
>> privileged. It is intended solely for the use of the 
>> individual or entity named on this message. If you are not 
>> the intended recipient, and have received this message in 
>> error, please notify us immediately by reply e-mail and then 
>> delete it from your system.
>>> 
>>> 
>>> 
>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>> 
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>> 
>> 
> Notice:  This e-mail message, together with any attachments, contains information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), and/or its affiliates Direct contact information for affiliates is available at http://www.merck.com/contact/contacts.html) that may be confidential, proprietary copyrighted and/or legally privileged. It is intended solely for the use of the individual or entity named on this message. If you are not the intended recipient, and have received this message in error, please notify us immediately by reply e-mail and then delete it from your system.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: decorating static content with sitemesh

Posted by "Kawczynski, David" <da...@merck.com>.
I have used struts tags in my decorating templates (past tense).
It is definitely possible... but not smart, IMHO.  
Why?  Response times, especially under load + time, were horrible.

I countered this by removing the struts tags from my templates, 
re-arranging the filters in web.xml, and configuring SiteMesh to 
use different decorator templates for different paths.  (Note that
this works when template content varies based on navigation path, not
on user attributes or something similar.)  Response times were much 
snappier after doing this.



> -----Original Message-----
> From: Philipp Leusmann [mailto:philipp.leusmann@rwth-aachen.de] 
> Sent: Thursday, January 21, 2010 12:26 PM
> To: Struts Users Mailing List
> Subject: Re: decorating static content with sitemesh
> 
> Ok, that would not be sufficient for me, since I use some 
> struts in my decorating template, as well.
> 
> I thought, maybe struts and sitemesh could decorate static 
> pages using the default action to resolve the stack
> 
> Philipp
> 
> Am 21.01.2010 um 18:01 schrieb Kawczynski, David:
> 
> > Plain sitemesh, with it's own filter in web.xml 
> > 
> >> -----Original Message-----
> >> From: Philipp Leusmann [mailto:philipp.leusmann@rwth-aachen.de] 
> >> Sent: Thursday, January 21, 2010 11:58 AM
> >> To: Struts Users Mailing List
> >> Subject: Re: decorating static content with sitemesh
> >> 
> >> David,
> >> 
> >> did you use plain sitemesh or the struts-sitemesh plugin?
> >> 
> >> Philipp
> >> 
> >> Am 21.01.2010 um 17:50 schrieb Kawczynski, David:
> >> 
> >>> I have used SiteMesh to decorate static content served
> >>> up by the app server.  If the static content is served
> >>> up by apache (or some other httpd server) you're out of
> >>> luck.  
> >>> 
> >>>> -----Original Message-----
> >>>> From: Philipp Leusmann [mailto:philipp.leusmann@rwth-aachen.de] 
> >>>> Sent: Thursday, January 21, 2010 11:39 AM
> >>>> To: Struts Users Mailing List
> >>>> Subject: decorating static content with sitemesh
> >>>> 
> >>>> Hi,
> >>>> 
> >>>> I am using the sitemesh-plugin to decorate my struts-site and 
> >>>> Im am wondering, if it is possible to decorate static-pages 
> >>>> using sitemesh.
> >>>> That is, I have some plain html pages which need to get the 
> >>>> same LAF the entire site has.
> >>>> I already added "<pattern>/html/*</pattern>" to the 
> >>>> decorators.xml, but all I get is an Exception when trying to 
> >>>> open the page:
> >>>> 
> >>>> java.lang.RuntimeException: javax.servlet.ServletException: 
> >>>> Error applying decorator: null
> >>>> 	
> >>>> com.opensymphony.sitemesh.webapp.decorator.BaseWebAppDecorator
> >>>> .render(BaseWebAppDecorator.java:39)
> >>>> 	
> >>>> com.opensymphony.sitemesh.webapp.SiteMeshFilter.doFilter(SiteM
> >>>> eshFilter.java:84)
> >>>> 	
> >>>> org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter.do
> >>>> Filter(StrutsPrepareFilter.java:82)
> >>>> 
> >>>> 
> >>>> The Exception is raised by a NullPointerException in 
> >>>> org.apache.struts2.sitemesh.OldDecorator2NewStrutsDecorator.re
> >>>> nder(Content, HttpServletRequest, HttpServletResponse, 
> >>>> ServletContext, SiteMeshWebAppContext) by 
> >>>> ValueStack vs = 
> >>>> Dispatcher.getInstance().getContainer().getInstance(ValueStack
> >>>> Factory.class).createValueStack(); 
> >>>> 
> >>>> "Dispatcher.getInstance()" returns null
> >>>> 
> >>>> FYI, I am using the sitemesh-2.4.2 hotfix from jira
> >>>> 
> >>>> Now, is this behaviour only a bug, or is it not meant to be 
> >>>> used with static content?
> >>>> 
> >>>> To find out by myself, I was desperately trying to compile 
> >>>> struts2 and xwork from svn, but it continously failed and I 
> >>>> gave up. (Maybe this is why the last nightly build is from 6 
> >>>> days ago?)
> >>>> 
> >>>> Hope somebody can help.
> >>>> 
> >>>> Regards,
> >>>> Philipp
> >>>> 
> >>>> 
> >> 
> ---------------------------------------------------------------------
> >>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >>>> For additional commands, e-mail: user-help@struts.apache.org
> >>>> 
> >>>> 
> >>> Notice:  This e-mail message, together with any 
> >> attachments, contains information of Merck & Co., Inc. (One 
> >> Merck Drive, Whitehouse Station, New Jersey, USA 08889), 
> >> and/or its affiliates Direct contact information for 
> >> affiliates is available at 
> >> http://www.merck.com/contact/contacts.html) that may be 
> >> confidential, proprietary copyrighted and/or legally 
> >> privileged. It is intended solely for the use of the 
> >> individual or entity named on this message. If you are not 
> >> the intended recipient, and have received this message in 
> >> error, please notify us immediately by reply e-mail and then 
> >> delete it from your system.
> >>> 
> >>> 
> >>> 
> >> 
> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >>> For additional commands, e-mail: user-help@struts.apache.org
> >>> 
> >> 
> >> 
> >> 
> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >> For additional commands, e-mail: user-help@struts.apache.org
> >> 
> >> 
> > Notice:  This e-mail message, together with any 
> attachments, contains information of Merck & Co., Inc. (One 
> Merck Drive, Whitehouse Station, New Jersey, USA 08889), 
> and/or its affiliates Direct contact information for 
> affiliates is available at 
> http://www.merck.com/contact/contacts.html) that may be 
> confidential, proprietary copyrighted and/or legally 
> privileged. It is intended solely for the use of the 
> individual or entity named on this message. If you are not 
> the intended recipient, and have received this message in 
> error, please notify us immediately by reply e-mail and then 
> delete it from your system.
> > 
> > 
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> > 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
Notice:  This e-mail message, together with any attachments, contains information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), and/or its affiliates Direct contact information for affiliates is available at http://www.merck.com/contact/contacts.html) that may be confidential, proprietary copyrighted and/or legally privileged. It is intended solely for the use of the individual or entity named on this message. If you are not the intended recipient, and have received this message in error, please notify us immediately by reply e-mail and then delete it from your system.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: decorating static content with sitemesh

Posted by Philipp Leusmann <ph...@rwth-aachen.de>.
Ok, that would not be sufficient for me, since I use some struts in my decorating template, as well.

I thought, maybe struts and sitemesh could decorate static pages using the default action to resolve the stack

Philipp

Am 21.01.2010 um 18:01 schrieb Kawczynski, David:

> Plain sitemesh, with it's own filter in web.xml 
> 
>> -----Original Message-----
>> From: Philipp Leusmann [mailto:philipp.leusmann@rwth-aachen.de] 
>> Sent: Thursday, January 21, 2010 11:58 AM
>> To: Struts Users Mailing List
>> Subject: Re: decorating static content with sitemesh
>> 
>> David,
>> 
>> did you use plain sitemesh or the struts-sitemesh plugin?
>> 
>> Philipp
>> 
>> Am 21.01.2010 um 17:50 schrieb Kawczynski, David:
>> 
>>> I have used SiteMesh to decorate static content served
>>> up by the app server.  If the static content is served
>>> up by apache (or some other httpd server) you're out of
>>> luck.  
>>> 
>>>> -----Original Message-----
>>>> From: Philipp Leusmann [mailto:philipp.leusmann@rwth-aachen.de] 
>>>> Sent: Thursday, January 21, 2010 11:39 AM
>>>> To: Struts Users Mailing List
>>>> Subject: decorating static content with sitemesh
>>>> 
>>>> Hi,
>>>> 
>>>> I am using the sitemesh-plugin to decorate my struts-site and 
>>>> Im am wondering, if it is possible to decorate static-pages 
>>>> using sitemesh.
>>>> That is, I have some plain html pages which need to get the 
>>>> same LAF the entire site has.
>>>> I already added "<pattern>/html/*</pattern>" to the 
>>>> decorators.xml, but all I get is an Exception when trying to 
>>>> open the page:
>>>> 
>>>> java.lang.RuntimeException: javax.servlet.ServletException: 
>>>> Error applying decorator: null
>>>> 	
>>>> com.opensymphony.sitemesh.webapp.decorator.BaseWebAppDecorator
>>>> .render(BaseWebAppDecorator.java:39)
>>>> 	
>>>> com.opensymphony.sitemesh.webapp.SiteMeshFilter.doFilter(SiteM
>>>> eshFilter.java:84)
>>>> 	
>>>> org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter.do
>>>> Filter(StrutsPrepareFilter.java:82)
>>>> 
>>>> 
>>>> The Exception is raised by a NullPointerException in 
>>>> org.apache.struts2.sitemesh.OldDecorator2NewStrutsDecorator.re
>>>> nder(Content, HttpServletRequest, HttpServletResponse, 
>>>> ServletContext, SiteMeshWebAppContext) by 
>>>> ValueStack vs = 
>>>> Dispatcher.getInstance().getContainer().getInstance(ValueStack
>>>> Factory.class).createValueStack(); 
>>>> 
>>>> "Dispatcher.getInstance()" returns null
>>>> 
>>>> FYI, I am using the sitemesh-2.4.2 hotfix from jira
>>>> 
>>>> Now, is this behaviour only a bug, or is it not meant to be 
>>>> used with static content?
>>>> 
>>>> To find out by myself, I was desperately trying to compile 
>>>> struts2 and xwork from svn, but it continously failed and I 
>>>> gave up. (Maybe this is why the last nightly build is from 6 
>>>> days ago?)
>>>> 
>>>> Hope somebody can help.
>>>> 
>>>> Regards,
>>>> Philipp
>>>> 
>>>> 
>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>> For additional commands, e-mail: user-help@struts.apache.org
>>>> 
>>>> 
>>> Notice:  This e-mail message, together with any 
>> attachments, contains information of Merck & Co., Inc. (One 
>> Merck Drive, Whitehouse Station, New Jersey, USA 08889), 
>> and/or its affiliates Direct contact information for 
>> affiliates is available at 
>> http://www.merck.com/contact/contacts.html) that may be 
>> confidential, proprietary copyrighted and/or legally 
>> privileged. It is intended solely for the use of the 
>> individual or entity named on this message. If you are not 
>> the intended recipient, and have received this message in 
>> error, please notify us immediately by reply e-mail and then 
>> delete it from your system.
>>> 
>>> 
>>> 
>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>> 
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>> 
>> 
> Notice:  This e-mail message, together with any attachments, contains information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), and/or its affiliates Direct contact information for affiliates is available at http://www.merck.com/contact/contacts.html) that may be confidential, proprietary copyrighted and/or legally privileged. It is intended solely for the use of the individual or entity named on this message. If you are not the intended recipient, and have received this message in error, please notify us immediately by reply e-mail and then delete it from your system.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: decorating static content with sitemesh

Posted by "Kawczynski, David" <da...@merck.com>.
Plain sitemesh, with it's own filter in web.xml 

> -----Original Message-----
> From: Philipp Leusmann [mailto:philipp.leusmann@rwth-aachen.de] 
> Sent: Thursday, January 21, 2010 11:58 AM
> To: Struts Users Mailing List
> Subject: Re: decorating static content with sitemesh
> 
> David,
> 
> did you use plain sitemesh or the struts-sitemesh plugin?
> 
> Philipp
> 
> Am 21.01.2010 um 17:50 schrieb Kawczynski, David:
> 
> > I have used SiteMesh to decorate static content served
> > up by the app server.  If the static content is served
> > up by apache (or some other httpd server) you're out of
> > luck.  
> > 
> >> -----Original Message-----
> >> From: Philipp Leusmann [mailto:philipp.leusmann@rwth-aachen.de] 
> >> Sent: Thursday, January 21, 2010 11:39 AM
> >> To: Struts Users Mailing List
> >> Subject: decorating static content with sitemesh
> >> 
> >> Hi,
> >> 
> >> I am using the sitemesh-plugin to decorate my struts-site and 
> >> Im am wondering, if it is possible to decorate static-pages 
> >> using sitemesh.
> >> That is, I have some plain html pages which need to get the 
> >> same LAF the entire site has.
> >> I already added "<pattern>/html/*</pattern>" to the 
> >> decorators.xml, but all I get is an Exception when trying to 
> >> open the page:
> >> 
> >> java.lang.RuntimeException: javax.servlet.ServletException: 
> >> Error applying decorator: null
> >> 	
> >> com.opensymphony.sitemesh.webapp.decorator.BaseWebAppDecorator
> >> .render(BaseWebAppDecorator.java:39)
> >> 	
> >> com.opensymphony.sitemesh.webapp.SiteMeshFilter.doFilter(SiteM
> >> eshFilter.java:84)
> >> 	
> >> org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter.do
> >> Filter(StrutsPrepareFilter.java:82)
> >> 
> >> 
> >> The Exception is raised by a NullPointerException in 
> >> org.apache.struts2.sitemesh.OldDecorator2NewStrutsDecorator.re
> >> nder(Content, HttpServletRequest, HttpServletResponse, 
> >> ServletContext, SiteMeshWebAppContext) by 
> >> ValueStack vs = 
> >> Dispatcher.getInstance().getContainer().getInstance(ValueStack
> >> Factory.class).createValueStack(); 
> >> 
> >> "Dispatcher.getInstance()" returns null
> >> 
> >> FYI, I am using the sitemesh-2.4.2 hotfix from jira
> >> 
> >> Now, is this behaviour only a bug, or is it not meant to be 
> >> used with static content?
> >> 
> >> To find out by myself, I was desperately trying to compile 
> >> struts2 and xwork from svn, but it continously failed and I 
> >> gave up. (Maybe this is why the last nightly build is from 6 
> >> days ago?)
> >> 
> >> Hope somebody can help.
> >> 
> >> Regards,
> >> Philipp
> >> 
> >> 
> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >> For additional commands, e-mail: user-help@struts.apache.org
> >> 
> >> 
> > Notice:  This e-mail message, together with any 
> attachments, contains information of Merck & Co., Inc. (One 
> Merck Drive, Whitehouse Station, New Jersey, USA 08889), 
> and/or its affiliates Direct contact information for 
> affiliates is available at 
> http://www.merck.com/contact/contacts.html) that may be 
> confidential, proprietary copyrighted and/or legally 
> privileged. It is intended solely for the use of the 
> individual or entity named on this message. If you are not 
> the intended recipient, and have received this message in 
> error, please notify us immediately by reply e-mail and then 
> delete it from your system.
> > 
> > 
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> > 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
Notice:  This e-mail message, together with any attachments, contains information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), and/or its affiliates Direct contact information for affiliates is available at http://www.merck.com/contact/contacts.html) that may be confidential, proprietary copyrighted and/or legally privileged. It is intended solely for the use of the individual or entity named on this message. If you are not the intended recipient, and have received this message in error, please notify us immediately by reply e-mail and then delete it from your system.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: decorating static content with sitemesh

Posted by Philipp Leusmann <ph...@rwth-aachen.de>.
David,

did you use plain sitemesh or the struts-sitemesh plugin?

Philipp

Am 21.01.2010 um 17:50 schrieb Kawczynski, David:

> I have used SiteMesh to decorate static content served
> up by the app server.  If the static content is served
> up by apache (or some other httpd server) you're out of
> luck.  
> 
>> -----Original Message-----
>> From: Philipp Leusmann [mailto:philipp.leusmann@rwth-aachen.de] 
>> Sent: Thursday, January 21, 2010 11:39 AM
>> To: Struts Users Mailing List
>> Subject: decorating static content with sitemesh
>> 
>> Hi,
>> 
>> I am using the sitemesh-plugin to decorate my struts-site and 
>> Im am wondering, if it is possible to decorate static-pages 
>> using sitemesh.
>> That is, I have some plain html pages which need to get the 
>> same LAF the entire site has.
>> I already added "<pattern>/html/*</pattern>" to the 
>> decorators.xml, but all I get is an Exception when trying to 
>> open the page:
>> 
>> java.lang.RuntimeException: javax.servlet.ServletException: 
>> Error applying decorator: null
>> 	
>> com.opensymphony.sitemesh.webapp.decorator.BaseWebAppDecorator
>> .render(BaseWebAppDecorator.java:39)
>> 	
>> com.opensymphony.sitemesh.webapp.SiteMeshFilter.doFilter(SiteM
>> eshFilter.java:84)
>> 	
>> org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter.do
>> Filter(StrutsPrepareFilter.java:82)
>> 
>> 
>> The Exception is raised by a NullPointerException in 
>> org.apache.struts2.sitemesh.OldDecorator2NewStrutsDecorator.re
>> nder(Content, HttpServletRequest, HttpServletResponse, 
>> ServletContext, SiteMeshWebAppContext) by 
>> ValueStack vs = 
>> Dispatcher.getInstance().getContainer().getInstance(ValueStack
>> Factory.class).createValueStack(); 
>> 
>> "Dispatcher.getInstance()" returns null
>> 
>> FYI, I am using the sitemesh-2.4.2 hotfix from jira
>> 
>> Now, is this behaviour only a bug, or is it not meant to be 
>> used with static content?
>> 
>> To find out by myself, I was desperately trying to compile 
>> struts2 and xwork from svn, but it continously failed and I 
>> gave up. (Maybe this is why the last nightly build is from 6 
>> days ago?)
>> 
>> Hope somebody can help.
>> 
>> Regards,
>> Philipp
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>> 
>> 
> Notice:  This e-mail message, together with any attachments, contains information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), and/or its affiliates Direct contact information for affiliates is available at http://www.merck.com/contact/contacts.html) that may be confidential, proprietary copyrighted and/or legally privileged. It is intended solely for the use of the individual or entity named on this message. If you are not the intended recipient, and have received this message in error, please notify us immediately by reply e-mail and then delete it from your system.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: decorating static content with sitemesh

Posted by "Kawczynski, David" <da...@merck.com>.
I have used SiteMesh to decorate static content served
up by the app server.  If the static content is served
up by apache (or some other httpd server) you're out of
luck.  

> -----Original Message-----
> From: Philipp Leusmann [mailto:philipp.leusmann@rwth-aachen.de] 
> Sent: Thursday, January 21, 2010 11:39 AM
> To: Struts Users Mailing List
> Subject: decorating static content with sitemesh
> 
> Hi,
> 
> I am using the sitemesh-plugin to decorate my struts-site and 
> Im am wondering, if it is possible to decorate static-pages 
> using sitemesh.
> That is, I have some plain html pages which need to get the 
> same LAF the entire site has.
> I already added "<pattern>/html/*</pattern>" to the 
> decorators.xml, but all I get is an Exception when trying to 
> open the page:
> 
> java.lang.RuntimeException: javax.servlet.ServletException: 
> Error applying decorator: null
> 	
> com.opensymphony.sitemesh.webapp.decorator.BaseWebAppDecorator
> .render(BaseWebAppDecorator.java:39)
> 	
> com.opensymphony.sitemesh.webapp.SiteMeshFilter.doFilter(SiteM
> eshFilter.java:84)
> 	
> org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter.do
> Filter(StrutsPrepareFilter.java:82)
> 
> 
> The Exception is raised by a NullPointerException in 
> org.apache.struts2.sitemesh.OldDecorator2NewStrutsDecorator.re
> nder(Content, HttpServletRequest, HttpServletResponse, 
> ServletContext, SiteMeshWebAppContext) by 
> ValueStack vs = 
> Dispatcher.getInstance().getContainer().getInstance(ValueStack
> Factory.class).createValueStack(); 
> 
> "Dispatcher.getInstance()" returns null
> 
> FYI, I am using the sitemesh-2.4.2 hotfix from jira
> 
> Now, is this behaviour only a bug, or is it not meant to be 
> used with static content?
> 
> To find out by myself, I was desperately trying to compile 
> struts2 and xwork from svn, but it continously failed and I 
> gave up. (Maybe this is why the last nightly build is from 6 
> days ago?)
> 
> Hope somebody can help.
> 
> Regards,
>  Philipp
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
Notice:  This e-mail message, together with any attachments, contains information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), and/or its affiliates Direct contact information for affiliates is available at http://www.merck.com/contact/contacts.html) that may be confidential, proprietary copyrighted and/or legally privileged. It is intended solely for the use of the individual or entity named on this message. If you are not the intended recipient, and have received this message in error, please notify us immediately by reply e-mail and then delete it from your system.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org