You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by bu...@apache.org on 2004/09/19 01:39:20 UTC

DO NOT REPLY [Bug 31287] New: - RenderTool on separate instance model fails

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=31287>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=31287

RenderTool on separate instance model fails

           Summary: RenderTool on separate instance model fails
           Product: Velocity
           Version: 1.1
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Tools
        AssignedTo: velocity-dev@jakarta.apache.org
        ReportedBy: shinobu.kawai@gmail.com


Using RenderTool on the separate instance model causes a NullPointerException.  
This happens because RenderTool uses the singleton model which is not 
initialized when you use the separate instance model.

You can reproduce this easily:
    VelocityEngine engine = new VelocityEngine();
    engine.init();
    
    Context context = new VelocityContext();
    context.put("render", new RenderTool());
    context.put("ctx", context);
    
    StringWriter writer = new StringWriter();
    String eval = "$render.eval($ctx, '')";
    engine.evaluate(context, writer, "bug", eval);

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