I just had a look at Sitemesh and it looks like what I want. There is one
thing that disturbs me, though, it looks as if sitemesh will build the page
every request, which causes quite some overhead, or am I mistaken there?

Pascal

On Fri, 17 Jul 2009 20:44:59 -0400, Wes Wannemacher <w...@wantii.com>
wrote:
> I'm on my phone so I only skimmed your message. If I read correctly,
> you should take a look at sitemesh.
> 
> -W
> 
> On 7/17/09, Pascal <pas...@voidmage.net> wrote:
>> Hello list,
>>
>> in Struts2 it is possible to do something like
>>
>> <html>
>> <body>
>>   <s:myMainNavigationMenu />
>>
>>   <h1>A page</h1>
>>   <p>Some content</p>
>> </body>
>> </html>
>>
>> This works ok, but my problem is that I have to change every single
>> page, if i would like to have a custom footer for every page, for
>> example.
>>
>> Now my question is: Is it possible to do something like this?
>>
>> <s:useTemplate name="myCommonTemplate">
>>     <s:setTemplateTag name="body">
>>         <h1>A page</h1>
>>         <p>Some content</p>
>>     </s:setTemplateTag>
>> </s:useTemplate>
>>
>> And as template definition say
>>
>> <!-- Main menu -->
>> <table>...</table>
>>
>> <s:insertTemplateTag name="body" />
>>
>> <!-- Footer -->
>> <p>This is the footer</p>
>>
>> I know it is possible to use parameters for templates, but they
>> obviously have huge limitations as I can't just put the tags there as I
>> did in my example.
>>
>> Also, I could do something like
>>
>> <s:myMainTemplate>
>> <s:param name="bodyPage" value="page1.jsp" />
>> </s:myMainTemplate>
>>
>> which I also don't want because I would have an extra (unnecessary)
page.
>>
>> So, is it possible to pass whole XML-Structures to templates? Maybe you
>> have some reasons why I shouldn't want what I'm suggesting here, I would
>> be eager to hear them! :-)
>>
>> Pascal
>>


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

Reply via email to