velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nathan Bubna <nat...@esha.com>
Subject Fw: exception using ViewRenderTool
Date Wed, 09 Jun 2004 21:08:15 GMT
Darren Davison said:
On Wednesday 09 June 2004 15:30, you wrote:
> > Darren said:
> > > I get the trace trying to do anything - including the simple examples
> > > in the JavaDocs for ViewRenderTool..
...
> > hmm.  have you init'ed Velocity before trying to use the tool?  try doing
> > Velocity.init() before using the tool.
...
> I've kept this off-list for now - it's not likely to be relevant to too many
> users but feel free to forward back to the list if you prefer.

oh, i'm sure there's at least someone else that's interested in this. :)

> I'm actually doing some development work on SpringFramework
> (http://www.springframework.org) and specifically enhancing the existing
> Velocity integration in the MVC part of the framework.  I need the render
> tool to support a couple of standard VM's that we will ship.

cool.

> Spring integrates Velocity and several other view technologies fairly
> seamlessly, so we don't use the usual config and initialization stuff in
> application code - it's handled within Spring.  Detail if you're
> particularly interested can be found at
>
http://www.springframework.org/docs/api/org/springframework/ui/velocity/package-summary.html
> and
>
http://www.springframework.org/docs/api/org/springframework/web/servlet/view/velocity/package-summary.html
>
> An instance of VelocityEngine is prepared internally (in Spring's
> VelocityEngineFactory class) and the init() method is certainly called on
> it.  Note that the problems I'm having are only with the render tool
> methods - Velocity itself is working fine in this context.  Templates that
> execute all other VTL and can display the render tool's toString() (just
> with $render) fail when using $render.eval(anythingAtAll)

ah.  yeah, the RenderTool currently uses the Velocity singleton.  if that
hasn't been initialized, then $render.eval($foo) won't work.  try calling
Velocity.init() before using the RenderTool.

anyway, once again, the singleton use is causing headaches with VelocityTools.
ugh.  a few weeks ago i spent some number of hours on major renovations of the
codebase to switch everything over to using VelocityEngine, but didn't quite
have time to finish up and test the changes.  also, i wasn't paying any
attention to doing proper deprecation for B.C. issues.  still, i think i may
have an acceptable solution to the logging issues the switch causes.  i'll see
if i can't find a few hours this week(end) to finish that up.

Nathan Bubna
nathan@esha.com


---------------------------------------------------------------------
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