You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Erich Meier <Er...@methodpark.de> on 2001/06/05 15:31:01 UTC

Re: Has anyone combined Velocity and Struts?

"Geir Magnusson Jr." wrote:
> You can find the complete code here in our nightly snapshot or CVS.
> it's under
> 
> /contrib/temporary/struts-velocity
> 
> I haven't had time to go further with it, but would love to work on it
> with someone interested - ask questions here (or privately as it may be
> off topic if we get too detailed...)

Thanks a lot for that starting point. After some struggling with different
tomcat and JDK versions, I finally managed to get it running.

Is there any way to feed the result generated by Velocity back in the
Struts engine? I'd like to generate Struts pages (with taglibs and
other stuff) via Velocity.

Or is this a too broken design?

Thanks for your help,
Erich
-- 
Dr. Erich Meier, Software Process Improvement
3Soft GmbH, method park, Wetterkreuz 19a, 91058 Erlangen, Germany
Tel. +49-9131-97206-316  mailto:Erich.Meier@methodpark.de
Fax. +49-9131-97206-200  http://www.methodpark.de/

Re: Context question: is it threadsafe?

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
Nick Bauman wrote:
> 
> Forget about web/servlets for a moment. I'm using Velocity in a mail
> templating system. (try _that_ with JSP!) I have a very basic question:
> 
> VelocityContext   context = new VelocityContext();
> 
> Is the VelocityContext object threadsafe? Or do I have to instantiate one
> for each call to the template I want?

It is not threadsafe.  You can reuse them, but a VelocityContext should
only be running down through one template at a time.  So if you have to,
pool them.

geir

> 
> Thanks for any insights.
> 
> --
> Nick Bauman
> Software Developer
> 3023 Lynn #22
> Minneapolis, MN
> 55416
> Mobile Phone: (612) 810-7406

-- 
Geir Magnusson Jr.                           geirm@optonline.net
System and Software Consulting
Developing for the web?  See http://jakarta.apache.org/velocity/
You have a genius for suggesting things I've come a cropper with!

Context question: is it threadsafe?

Posted by Nick Bauman <ni...@cortexity.com>.
Forget about web/servlets for a moment. I'm using Velocity in a mail
templating system. (try _that_ with JSP!) I have a very basic question:

VelocityContext   context = new VelocityContext();

Is the VelocityContext object threadsafe? Or do I have to instantiate one
for each call to the template I want? 

Thanks for any insights.

-- 
Nick Bauman
Software Developer
3023 Lynn #22
Minneapolis, MN
55416
Mobile Phone: (612) 810-7406


Re: Has anyone combined Velocity and Struts?

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
Erich Meier wrote:
> 
> "Geir Magnusson Jr." wrote:
> > You can find the complete code here in our nightly snapshot or CVS.
> > it's under
> >
> > /contrib/temporary/struts-velocity
> >
> > I haven't had time to go further with it, but would love to work on it
> > with someone interested - ask questions here (or privately as it may be
> > off topic if we get too detailed...)
> 
> Thanks a lot for that starting point. After some struggling with different
> tomcat and JDK versions, I finally managed to get it running.
> 
> Is there any way to feed the result generated by Velocity back in the
> Struts engine? I'd like to generate Struts pages (with taglibs and
> other stuff) via Velocity.
> 
> Or is this a too broken design?
> 

Hm.  I have used Velocity as a filter stage in a kind of iterative
XSLT-based content engine, and from that have come to believe that
anything is possible.

Can you give a short example of what you are trying to do? (real
short...)

geir

-- 
Geir Magnusson Jr.                           geirm@optonline.net
System and Software Consulting
Developing for the web?  See http://jakarta.apache.org/velocity/
You have a genius for suggesting things I've come a cropper with!