Template writer question

2007-01-04 Thread John
This may be a newbie question, but I'm trying to figure out which of the following two methods is better for performing the template merge and outputting it in a servlet? Using the HttpServletResponse's Writer object? Writer writer = response().getWriter(); template.merge(context,

VelocityView and toolbox - location of tool instance

2007-01-04 Thread Townson, Chris
Hi, I think this is a simple question ... although I could be having one of those winter, late-afternoon brain-dead moments ... Whereabouts exactly are tool class instances kept once they have been initialized when using VelocityView and toolbox.xml? In other words, from where and how does one

Re: Template writer question

2007-01-04 Thread Nathan Bubna
What version of the VelocityViewServlet are you taking that code from? It hasn't looked that way in some time. I'd recommend taking a look at a more recent version of the VelocityViewServlet's code to begin. Beyond that, i can't really tell whether it is better for your application to do what VV

Re: VelocityView and toolbox - location of tool instance

2007-01-04 Thread Nathan Bubna
I'm a little surprised that the method you tried is failing. I haven't written many custom directives though, so i'm not sure how to help. Does anyone else out there know why the context provided to the directive wouldn't have access to the tools? That said, where instantiated tools is kept va

Re: Template writer question

2007-01-04 Thread John
I got it from the VelocityViewServlet in velocity-tools-1.2-src.zip. I guess the basic question was - short of profiling the app - is one method faster and/or better than the other? It would seem to me like the pooled VelocityWriters are the way to go? John On 1/4/07, Nathan Bubna <[EMAIL PROTEC

Re: Template writer question

2007-01-04 Thread Nathan Bubna
That's very odd and slightly disconcerting that that code came from a file named 1.2. Looking at the version history, the response's output stream hasn't been the default since 1.0: http://svn.apache.org/viewvc/velocity/tools/tags/VELTOOLS_1_2_FINAL/src/java/org/apache/velocity/tools/view/servle