struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sandeep Takhar <sandeep_tak...@yahoo.com>
Subject Re: Duplication of Template Files Solution
Date Thu, 01 Nov 2001 16:05:15 GMT
man i suck, i did it again.

finish the thought, than send the mail.

ok -- what I meant was that unlike what your initial
e-implies: that tiles works exactly like
template-tags, what I meant was that you can create
the duplicate definition in the xml file and than
reference this layout definition/component in the
action forward of a struts-config file.  I like this
solution better because you have clearly defined all
the layouts and are just forwarding to the correct
one.

This means that you don't need the duplicated jsp
which is a pain to maintain.  So either solution (the
one you described) and this one will get rid of that
duplicate jsp.

- Sandeep
--- Sandeep Takhar <sandeep_takhar@yahoo.com> wrote:
> Tiles allows you to do this as well.
> 
> btw: I have replied to another reply in this same
> thread about other things I like about tiles.  In my
> usual haste I deleted the original message when I
> realized there was something more I wanted to say.
> 
> - sandeep
> --- Darryl Pentz <darryl@vardus.co.za> wrote:
> > I've discovered quite by accident that the Struts
> > templating framework
> > allows me to eliminate duplication of my JSP pages
> > by simply including the
> > body page inline to the template definition page.
> By
> > this I mean I combine
> > both pages into one as follows:
> > 
> > <template:insert ...>
> > 	<template:put name="header" ... />
> > 	<template:put name="nav" ... />
> > 	<template:put name="body" ... />
> > 
> > 		... BODY HTML GOES HERE ...
> > 
> > 	</template:put>
> > </template:insert>
> > 
> > I'd previously enquired on this list how I could
> > eliminate the duplication
> > of the pages where the main body HTML exists in a
> > separate JSP page that is
> > simply referred to from the definition file i.e.
> > <template:put name="body"
> > content="/blah/blah/body.jsp"/>. Strangely nobody
> > responded with the above
> > solution so I'm wondering is this simply a
> > side-effect of the PutTag class
> > or Craig, did you intend for it to work this way?
> > I'm quite surprised I
> > haven't seen this technique used in any of the
> > examples. Rather, the
> > duplication is suggested. The new Tiles extension
> > allows the above which
> > prompted me to try it with the Struts template tag
> > library just for grins,
> > and it worked!
> > 
> > Is there a problem with doing it inline like I
> > illustrate above? I looked at
> > the source code and I see the PutTag class does
> > extend BodyTagSupport so
> > everything should work fine. So far, the stuff
> I've
> > played around with seems
> > to work fine with no problems.
> > 
> > Any feedback would be appreciated.
> > 
> > thanks,
> > Darryl Pentz
> > 
> > 
> > --
> > To unsubscribe, e-mail:  
> >
> <mailto:struts-user-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail:
> > <mailto:struts-user-help@jakarta.apache.org>
> > 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Make a great connection at Yahoo! Personals.
> http://personals.yahoo.com
> 
> --
> To unsubscribe, e-mail:  
> <mailto:struts-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:struts-user-help@jakarta.apache.org>
> 


__________________________________________________
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com

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


Mime
View raw message