Hi Tim.

The tools can easily be used without the VelocityViewServlet.

        import org.apache.velocity.tools.view.XMLToolboxManager;
        ...
        XMLToolboxManager manager = new XMLToolboxManager();
        manager.load("...../toolbox.xml");
        Map toolbox = manager.getToolbox(null);

You can then create a new Velocity context with:

        VelocityContext context = new VelocityContext(toolbox);

If the context already exists, then you can create a chained context:

        VelocityContext chained = new VelocityContext(toolbox,context);

You'll need the last VelocityTools release to do so (1.3). It may be
possible with 1.2 but with a slightly more complex code.


  Claude

Le jeudi 15 mars 2007 à 15:53 -0600, White, Tim a écrit :
> Hello!
>  
>  Is there a straightforward way to add Velocity Tools to a standalone
> Velocity Engine (i.e. not the VelocityViewServlet)?
>  
>  We have a custom JSP tag that is pulling in templates from a special
> backend, and we're trying to figure out how to add the Velocity tools to
> the context, without bein able to access toolbox.xml.
>  
>  Ideally, if there were some params we could set on the instance or the
> context, that seems like the way to do it.
>  
> Thanks in advance!
>  
> Tim
> 
> 
> This communication is the property of Qwest and may contain confidential or
> privileged information. Unauthorized use of this communication is strictly 
> prohibited and may be unlawful.  If you have received this communication 
> in error, please immediately notify the sender by reply e-mail and destroy 
> all copies of the communication and any attachments.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to