Thanks Cedric,
This confirms what I thought was happening.
It seems cumbersome to me to have a one to one mapping between my
content and my layout. If I have one layout that I am happy with for
my entire site (e.g. standard header, footer, sidebar - which may
dynamically
change their appearance based on current session state) - it would be
nice if I could tell the struts framework "when processing my content -
always
process these standard JSPs (e..g header.jsp, footer.jsp) for me and then
insert
the current content page. Why should I have to specify the same template
over
and over again ( the only difference between each template file is the
content="foo.html" entry).
Of course you would need a way to override this default behaviour if you
wanted to layout
a page with a different template.
The analogy that comes to mind is telling your word processor to always
apply the same
master page (header, footer, etc.) to your content. The page numbers, etc.
may change
dynamically - but the structure is always the same.
Can this be done in struts? I am guessing one could write a dispatcher
servlet that
would have this kind of behaviour - but I am not sure how that would be
accomplished
in struts.
Thanks
Warren
----- Original Message -----
From: "Cedric Dumoulin" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, January 11, 2001 6:53 AM
Subject: Re: Newbie question on templates
>
> Hi Warren,
>
> In the Struts Template example, you define one template
> (chapterTemplate.jsp) common to all your web pages.
> Then, you define one jsp file for each of your web page that use the
> template (introduction.jsp, optional.jsp, ...). In each jsp file you
specify
> template argument values (header, body, ...). If you want web pages with
> common part (ex : sidebar), define another template fixing this property
> value. This template could possibly use the more general template.
>
> You can also have a look to my Component proposal
> (http://gauss.ficsgrp.com/cdm). This can be seem as an extended template
> library. It provides all Struts Template functionalities (with same
syntax),
> plus new useful functionalities to develop reusable 'web components'.
> I have rewrite the struts-template example using the Components. Chek it
!
> Any comments are welcome to improve this Component library.
>
> Cedric
>
> Warren Strange wrote:
>
> > Hi,
> >
> > I am just get started with struts, and have a question on templates.
> >
> > >From the example given (templates-example) , it appears that you need
a
> > template file
> > for each content JSP that you want to lay out using the template. For
> > example:
> >
> > introduction.html (the content), and introduction.jsp (the template
> > reference)
> >
> > optional.html (the content) and optional.jsp (the template reference)
> >
> > and so on....
> >
> > This approach seems rather cumbersome to me. If you want to change the
> > template
> > you might have go back and edit all the template reference files (e.g.
say
> > you add
> > 'rightSideBar' content, or something like that).
> >
> > I want to define one common template (which includes standard headers,
> > footer,
> > etc. - possibly changing their behavior dynamically) and have it applied
> > automatically
> > to all my content.
> >
> > How is done?
> >
> > Thanks
> >
> > Warren
>
>