velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nathan Bubna" <nbu...@gmail.com>
Subject Re: toolbox.xml problem
Date Mon, 28 Jul 2008 16:20:42 GMT
On Mon, Jul 28, 2008 at 8:38 AM, LAU, Roger, GBM <Roger.LAU@rbs.com> wrote:
> Thanks Nathan, that worked. I was creating a new VelocityContext. btw, most of the examples
in the Developer's Guide specify creating contexts in this way.

well, the Developer's Guide isn't really meant to have VelocityTools'
specific info.  perhaps we can find another place for such examples...

> Cheers
> Roger
>
> -----Original Message-----
> From: Nathan Bubna [mailto:nbubna@gmail.com]
> Sent: 28 July 2008 16:26
> To: Velocity Users List
> Subject: Re: toolbox.xml problem
>
> *How* are you using the VelocityViewServlet?  The tools are made
> available via the Context created by the createContext(...) method.
> If you do not use VVS.doRequest(req,res) to process requests, then you
> must call createContext(...) yourself and use that Context to merge
> with your templates.
>
> On Mon, Jul 28, 2008 at 3:33 AM, LAU, Roger, GBM <Roger.LAU@rbs.com> wrote:
>> Hi,
>>
>> my templates are not able to access the tools I have configured in my toolbox.xml
file. I've tried both <data> and <tool> elements with no success. I am using the
VelocityViewServlet. I've confirmed that the correct toolbox.xml file is being read through
setting deliberately incorrect class names for the DateTool and seeing resulting errors in
the Catalina.log file.
>>
>> Here is my toolbox.xml files. Can anyone shine any light this please.
>>
>> <?xml version="1.0"?>
>> <toolbox>
>>  <data type="number">
>>     <key>libor</key>
>>     <value>5.5609</value>
>>  </data>
>>  <!-- logger object-->
>>  <tool>
>>    <key>logger</key>
>>    <scope>application</scope>
>>    <class>org.apache.velocity.tools.generic.log.LogSystemCommonsLog</class>
>>  </tool>
>>  <!-- format dates-->
>>  <tool>
>>    <key>date</key>
>>    <scope>request</scope>
>>    <class>org.apache.velocity.tools.generic.DateTool</class>
>>    <parameter name="format" value="yyyy-M-d"/>
>>  </tool>
>>  <!-- format number-->
>>  <tool>
>>    <key>number</key>
>>    <scope>application</scope>
>>    <class>org.apache.velocity.tools.generic.NumberTool</class>
>>  </tool>
>> </toolbox>
>>
>>
>>
>>
>>
>>
>>
>> ***********************************************************************************
>> The Royal Bank of Scotland plc. Registered in Scotland No 90312. Registered Office:
36 St Andrew Square, Edinburgh EH2 2YB.
>> Authorised and regulated by the Financial Services Authority
>>
>> This e-mail message is confidential and for use by the
>> addressee only. If the message is received by anyone other
>> than the addressee, please return the message to the sender
>> by replying to it and then delete the message from your
>> computer. Internet e-mails are not necessarily secure. The
>> Royal Bank of Scotland plc does not accept responsibility for
>> changes made to this message after it was sent.
>>
>> Whilst all reasonable care has been taken to avoid the
>> transmission of viruses, it is the responsibility of the recipient to
>> ensure that the onward transmission, opening or use of this
>> message and any attachments will not adversely affect its
>> systems or data. No responsibility is accepted by The
>> Royal Bank of Scotland plc in this regard and the recipient should carry
>> out such virus and other checks as it considers appropriate.
>> Visit our websites at:
>> www.rbs.com
>> www.rbs.com/gbm
>> www.rbsgc.com
>> ***********************************************************************************
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
>> For additional commands, e-mail: user-help@velocity.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> For additional commands, e-mail: user-help@velocity.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> For additional commands, e-mail: user-help@velocity.apache.org
>
>

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


Mime
View raw message