You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by "Payne, Matthew" <pa...@Telerx.com> on 2003/09/29 18:41:55 UTC
Mixing jsp content with tiles using tiles tool
I would like the mix jsp rendered content with velocity rendered content via
struts/tiles.
Is this a possiblity.
Tiles seem to work well when a definition is all jsp or a definition is all
velocity. However, mixing the two does not work well at all.
If a definition is based on a jsp layout, just an exeption page is returned.
If a definition is based on a velocity layout, no exceptions are thrown, but
the jsp content is included as "source", and is not executed(not good).
One important thing to note is that mixing velocity in a jsp layout works
perfectly on Resin(not tomcat). I have not tried doing it the other way
around.
Is the following a possibly?
<definition name="Vtest"
path="/TableBased.vm">
<put name="header"
value="/header.jsp"/>
<put name="footer"
value="/footer.jsp"/>
<put name="body"
value="/center/listThemes.vm"/>
<put name="rail"
value="/rail.jsp"/>
</definition>
In TableBased, I include my content by -->$tiles.header or $tiles.body
If anyone been able to get this to work, let me know.
Matthew Payne
Re: Mixing jsp content with tiles using tiles tool
Posted by Nathan Bubna <na...@esha.com>.
Payne, Matthew said:
> I would like the mix jsp rendered content with velocity rendered content via
> struts/tiles.
> Is this a possiblity.
i think rendering Velocity amidst JSP is feasible, but rendering JSP amidst
Velocity is almost certainly not.
> Tiles seem to work well when a definition is all jsp or a definition is all
> velocity. However, mixing the two does not work well at all.
no surprise there. they're two very different things that are typically
rendered by different servlets. so rendering both during the same request is
definitely atypical and will likely take a bit of work.
Matt Raible has apparently developed a JSP tag for rendering Velocity.
there's also the Veltag (http://jakarta.apache.org/velocity/veltag.html).
as for getting the VelocityTools to work within Veltag, there has been some
discussion on this in the past
(http://marc.theaimsgroup.com/?l=velocity-user&m=105043871819828&w=2).
> If a definition is based on a jsp layout, just an exeption page is returned.
of course, JSP is not designed to render Velocity,
> If a definition is based on a velocity layout, no exceptions are thrown, but
> the jsp content is included as "source", and is not executed(not good).
and Velocity is not designed to render JSP.
> One important thing to note is that mixing velocity in a jsp layout works
> perfectly on Resin(not tomcat). I have not tried doing it the other way
> around.
...
i'm not surprised you have some success mixing in velocity syntax on Resin,
but i would be surprised if VelocityTools was working there.
http://www.caucho.com/resin/ref/velocity.xtp
anyway, i'm no Tiles expert, but as far as i know, it won't do the rendering
for you, and neither Jasper (Tomcat's JSP thingy) nor the VelocityViewServlet
can render mixed JSP and Velocity without using something like the Veltag.
Nathan Bubna
nathan@esha.com
---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org
RE: Mixing jsp content with tiles using tiles tool
Posted by Matt Raible <ma...@raibledesigns.com>.
I've mixed Tiles and Velocity by creating a tag library that can render
velocity templates:
<mytag:content path="/path/to/template/"/>
Seems to work fairly well.
Matt
-----Original Message-----
From: Payne, Matthew [mailto:payne@Telerx.com]
Sent: Monday, September 29, 2003 10:42 AM
To: 'velocity-user@jakarta.apache.org'
Subject: Mixing jsp content with tiles using tiles tool
I would like the mix jsp rendered content with velocity rendered content
via struts/tiles.
Is this a possiblity.
Tiles seem to work well when a definition is all jsp or a definition is
all velocity. However, mixing the two does not work well at all.
If a definition is based on a jsp layout, just an exeption page is
returned.
If a definition is based on a velocity layout, no exceptions are thrown,
but the jsp content is included as "source", and is not executed(not
good).
One important thing to note is that mixing velocity in a jsp layout
works perfectly on Resin(not tomcat). I have not tried doing it the
other way around.
Is the following a possibly?
<definition name="Vtest"
path="/TableBased.vm">
<put name="header"
value="/header.jsp"/>
<put name="footer"
value="/footer.jsp"/>
<put name="body"
value="/center/listThemes.vm"/>
<put name="rail"
value="/rail.jsp"/>
</definition>
In TableBased, I include my content by -->$tiles.header or $tiles.body
If anyone been able to get this to work, let me know.
Matthew Payne
---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org