velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jonathan Revusky <...@revusky.com>
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( )

Bart,

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:

http://freemarker.org/docs/pgui_misc_servlet.html

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

I hope that's helpful.

Jonathan Revusky
-- 
lead developer FreeMarker project, http://freemarker.org


> 
> 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*  
> http://join.msn.com/?page=features/junkmail



---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Mime
View raw message