sorry ... acted a little hastily there :P
here are the proper tiles-defs with a seperate 'body' template:
<tiles-definitions>
<definition name=".main" path="/layout.vm">
<put name="head" value="head.vm" />
<put name="body" value=".main.body"/>
</definition>
<definition name=".news" extends=".main">
<put name="body" value=".news.body"/>
</definition>
<definition name=".mail" extends=".main">
<put name="body" value=".mail.body"/>
</definition>
<definition name=".main.body" path="/body.vm">
<put name="nav" value="defaultNav.vm"/>
<put name="someContent" value="defaultContent.vm"/>
</definition>
<definition name=".news.body" extends=".main.body">
<put name="nav" value="newsNav.vm"/>
<put name="someContent" value="newsContent.vm"/>
</definition>
<definition name=".mail.body" extends=".main.body">
<put name="nav" value="mailNav.vm"/>
<put name="someContent" value="mailContent.vm"/>
</definition>
</tiles-definitions>
cheers,
Marin�
> -----Original Message-----
> From: Tim OBrien [mailto:[EMAIL PROTECTED]
> Sent: 8. september 2003 16:57
> To: 'Velocity Developers List'
> Subject: RE: using TilesTool was RE: Veltag and JJAR
>
>
> Not quite, but I'll take it. The .news definition extends
> the .main definition, and adds (or in the real case
> overrides) some attributes. Assume that .main is something
> like the layout of www.yahoo.com, .news is an extension of
> the .main layout for news.yahoo.com, and .mail is an
> extension of the .main layout for mail.yahoo.com.
>
> I'm migrating from a JSP app which makes heavy use of the
> Tiles taglib - the path of least resistance for me at this
> time is to use FreeMarker.
>
> Tim
>
> -----Original Message-----
> From: Marin� A. J�nsson [mailto:[EMAIL PROTECTED]
> Sent: Friday, September 05, 2003 8:41 PM
> To: 'Velocity Developers List'
> Subject: RE: using TilesTool was RE: Veltag and JJAR
>
> yeah ... it's just like i thought ... pretty funky ;)
>
> the correct tiles-defs for your purposes should probably be
> more like this:
>
>
> <tiles-definitions>
>
> <definition name=".main" path="/layout.vm">
> <put name="head" value="head.vm" />
> <put name="body" value=".news" />
> </definition>
>
> <definition name=".news" path="/body.vm">
> <put name="nav" value="newsNav.vm"/>
> <put name="someContent" value="newsContent.vm"/>
> </definition>
>
> </tiles-definitions>
>
>
> then, you forward to .main in the relevant struts action mapping :)
>
>
> a cleaner version of the templates would be:
>
> in layout.vm:
>
> <html>
> $tiles.head
> $tiles.body
> </html>
>
> in body.vm:
>
> <body>
> $tiles.nav
> $tiles.someContent
> </body>
>
> (a little better than .get() ... and a whole lot better then
> the #parse workaround ;)
>
> i think a RTFM comment would be appropriate here ;) but i
> hope this helps.
>
> Marin�
>
>
>
> > -----Original Message-----
> > From: Tim OBrien [mailto:[EMAIL PROTECTED]
> > Sent: 5. september 2003 15:16
> > To: 'Velocity Developers List'
> > Subject: RE: using TilesTool was RE: Veltag and JJAR
> >
> >
> > Marin�,
> >
> > Here is the tiles-defs.xml that I am using.
> >
> > <tiles-definitions>
> >
> > <definition name=".main" path="/body.vm">
> > <put name="head" value="/head.vm" />
> > <put name="body" value="/body.vm" />
> > </definition>
> >
> > <definition name=".news" extends=".main">
> > <put name="nav" value="/newsNav.vm"/>
> > <put name="someContent" value="/newsContent.vm"/>
> > </definition>
> >
> > </tiles-definitions>
> >
> > I'm pretty sure they are funky as well. Although, this is
> > what I've ended up with that works.
> >
> > Tim
> >
> > -----Original Message-----
> > From: Marin� A. J�nsson [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, September 04, 2003 7:04 PM
> > To: 'Velocity Developers List'
> > Subject: RE: using TilesTool was RE: Veltag and JJAR
> >
> > hmm ... I'm pretty sure your tiles definitions are a little
> > funky ;) Could you perhaps show me the tiles-defs for this
> > little demo?
> >
> > Marin�
> >
> > > -----Original Message-----
> > > From: Tim OBrien [mailto:[EMAIL PROTECTED]
> > > Sent: 4. september 2003 23:28
> > > To: 'Velocity Developers List'
> > > Subject: using TilesTool was RE: Veltag and JJAR
> > >
> > >
> > > Assume that you have a top-level layout in "layout.vm" and it
> > > contains the
> > > following:
> > >
> > > <html>
> > > $tiles.get('head')
> > > $tiles.get('body')
> > > </html>
> > >
> > > Now assume that "body" refers to another template
> "body.vm", which
> > > in turn contains the following:
> > >
> > > <body>
> > > $tiles.get('nav')
> > > $tiles.get('someContent')
> > > </body>
> > >
> > > I run this, I debug TilesTool with Eclipse, and when
> > > TilesTool.get() tries to get the attribute 'nav', the
> > > ComponentContext object contains zero attributes - so I'll
> > > get a ServletException because TilesTool can't find
> > > 'nav'..... My solution is to just call #parse. So, layout.vm
> > > would call:
> > >
> > > <html>
> > > #parse( $tiles.getString('head') )
> > > #parse( $tiles.getString('body') )
> > > </html>
> > >
> > > and "body.vm" would have:
> > >
> > > <body>
> > > #parse( $tiles.getString('nav') )
> > > #parse( $tiles.getString('someContent') )
> > > </body>
> > >
> > > I was going to try to use the veltag so that I could use
> the Tiles
> > > taglib, but after 5 minutes going down that path, I was
> reminded of
> > > the fact that I dislike using JSP w/ taglibs - too much typing.
> > >
> > > Tim
> > >
> > >
> > >
> > >
> > >
> > > -----Original Message-----
> > > From: Marin� A. J�nsson [mailto:[EMAIL PROTECTED]
> > > Sent: Thursday, September 04, 2003 6:13 PM
> > > To: 'Velocity Developers List'
> > > Subject: RE: Veltag and JJAR
> > >
> > > yup ... you've also aroused *my* curiosity ... since the
> TilesTool
> > > is *my* baby ;) have any more info on the problem?
> > >
> > > cheers,
> > > Marin�
> > >
> > > > -----Original Message-----
> > > > From: Nathan Bubna [mailto:[EMAIL PROTECTED]
> > > > Sent: 4. september 2003 21:46
> > > > To: Velocity Developers List
> > > > Subject: Re: Veltag and JJAR
> > > >
> > > >
> > > > Tim OBrien said:
> > > > > I was using Struts w/ Velocity and I wanted to work with
> > > > the tiles tag
> > > > > library because I was having problems calling
> > > > $tiles.get('blah') from
> > > > > anything but the top layout.
> > > >
> > > > hmm. so this was a problem with the TilesTool? can you give an
> > > > example or any more info on your setup? we'd like to
> get issues
> > > > with the new tools worked out before the next release,
> and others
> > > > may be experiencing the same problem.
> > > >
> > > > > After experimenting with mixed JSP/Velocity
> > > > > content, I decided to take a more pragmatic approach
> > and solve my
> > > > > problem by referencing tiles using #parse(
> > > > $tiles.getString('menu') ).
> > > > > So, my initial need to use veltag is no more.
> > > >
> > > > glad you found a way that works for you! there are
> > certainly quite
> > > > a few options for doing layout stuff with
> > > > VelocityView/VelocityStruts. (of course, we'd like them
> > all to work
> > > > for you :)
> > > >
> > > > > But.. trying to build veltag was a confusing
> > experience. Someone
> > > > > should update the build and the site, and make no mention
> > > of JJAR -
> > > > > JJAR seems to be dead. I had to login to Minotaur to
> > > > figure that out.
> > > > > I'll volunteer to refactor this build if no one else has the
> > > > > bandwidth.
> > > >
> > > > i believe veltag and it's docs are in the main velocity
> > cvs. so, i
> > > > can't check in those changes, but i'm sure the core velocity
> > > > committers would appreciate any contribution like that.
> > just file
> > > > the report and any patches with bugzilla.
> > > >
> > > > Nathan Bubna
> > > > [EMAIL PROTECTED]
> > > >
> > > >
> > > >
> > >
> >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail:
> > [EMAIL PROTECTED]
> > > > For additional commands, e-mail:
> > > [EMAIL PROTECTED]
> > > >
> > > >
> > >
> > >
> > >
> > >
> >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> > > For additional commands, e-mail:
> > [EMAIL PROTECTED]
> > >
> > >
> >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> > > For additional commands, e-mail:
> > [EMAIL PROTECTED]
> > >
> > >
> >
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail:
> [EMAIL PROTECTED]
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail:
> [EMAIL PROTECTED]
> >
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]