velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jonathan Revusky <>
Subject Re: Veltag with struts tools
Date Thu, 05 Jun 2003 20:50:14 GMT
bart wood wrote:
> Hi,
> I want to use velocity in my struts application.  I need the ability to 
> re-use a lot of existing jsp/struts tags but mix in velocity markup.  
> The Veltag tag library seemed very promising to allow me to do this.  
> However, I found that mixing the VelocityTag code with the 
> VelocityViewServlet code is not possible.  I downloaded the source of 
> both and peeked around to figure out how to mix the two.  I tried this 
> piece of code in VelocityTag.doEndTag( )


If you are interested in using Struts sans JSP, you might consider 
FreeMarker for your view layer. FreeMarker is an open-source template 
engine, much like Velocity, but generally more powerful and is also 
undergoing more active development.

FreeMarker integrates quite well with struts, but also you get to have 
your cake and eat it too, since FM now supports the use of 3rd party JSP 
taglibs from templates, so if there is some functionality in a taglib 
that you need, you can still use it. Velocity doesn't have this feature 
and, truth told, probably never will. You see, Velocity is basically a 
dead project. No new development on the template engine itself has 
occurred for about a year.

Here is the manual section that says how to use FM in conjunction with 
Struts and with JSP taglibs in general:

FreeMarker is also used as the view component in various web application 
frameworks. Notably, "Open for Business", recently 
decided to move over completely from using JSP to using FM.

I hope that's helpful.

Jonathan Revusky
lead developer FreeMarker project,

> RequestDispatcher rd = 
> pageContext.getServletContext().getNamedDispatcher( "/velocity" );
> rd.include( pageContext.getRequest( ), pageContext.getResponse( ) );
> The VelocityViewServlet.doRequest method is called but it crashes.  
> Probably because the VelocityViewServlet is expecting a file to parse 
> instead of the tag body.  I thought of creating a temporary file but 
> that is really messy.  Does anyone have any code that does this same 
> thing or something similar.  How can I combine the Veltag functionality 
> with the velocity tools package?
> Thanks
> _________________________________________________________________
> The new MSN 8: advanced junk mail protection and 2 months FREE*  

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

View raw message