velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nathan Bubna <>
Subject Re: Velocity/Struts template question
Date Tue, 20 Jul 2004 17:25:21 GMT
Mike Haberman said:
>    I've just started an attempt to port a Turbine/Velocity project to
> Struts/Velocity.  When I am rendering the page, I need to know the name
> of the template that I am rendering (without having to do
> #set ($templateName = "index.vm") in every template.
>   In some cases, the request will be going through struts frist,
> in others it will be going just through the VelocityLayoutServlet.
>   Is there a tool that does this or do I need to extend
> to add to the context the name of the current template being rendered?

i'm not aware of a current tool that does this.  so, yeah, the simplest way is
probably to extend the VLS and add the template name to the context during the
handleRequest(req,res,ctx) method.  though do note that that method is not
empty, so you will likely want to call super.handleRequest() or duplicate the
superclass content for that method.

Nathan Bubna

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message