Hi Chris,

Can you let us know which version of Velocity Tools you're using? I suspect this precise method wouldn't work with the latest dev version as it no longer uses the Velocity Singleton.

- simon

Townson, Chris wrote:
Hi Shinobu - thanks again for your help and my apologies for my java
ignorance! (RTFM, as they say ;D )

I have added the cparse macro to VM_global_library.vm and added the
necessary entry to the toolbox.xml, as described in the maillist archive URL
below.

I then called the package com.npg and placed it in /WEB-INF/src/com/npg,
saving the file as TemplateExistsTool.java. I also copied over the
velocity+commons+avalon logkit source (which I placed in
/WEB-INF/src/org/apache etc...). I did this attempting to follow
instructions of compiling java packages on this web page:
http://www.yoda.arachsys.com/java/packages.html. The compile seemed to go
fine, creating TemplateExistsTool.class. I left this file in the same folder
as the source file, and placed a copy of it in /WEB-INF/classes.

Finally, I restarted Tomcat.

However, the #cparse instruction is not working for some reason which I am
unable to diagnose so far :(

Being new to Java and Velocity, I'm probably missing something very obvious!

If anyone can tell me what I am doing wrong, I would be extremely grateful.

My thanks once again for your help,

Kind regards,

Chris



I would like to use the #cparse (silent parse) command which is described

here: http://mail-archives.apache.org/mod_mbox/jakarta-velocity-user/200406.mbox/% [EMAIL PROTECTED]

I understand the bit about adding to toolbox.xml, but what do I have to

do with the other bits of code described there (concerning package and macro)?


The package can be anything you want. As for the macros, check out the

user guide. VM_global_library.vm should be a good place to put it. http://jakarta.apache.org/velocity/user-guide.html#Velocimacros

******************************************************************************** DISCLAIMER: This e-mail is confidential and should not be used by anyone who is
not the original intended recipient. If you have received this e-mail in error
please inform the sender and delete it from your mailbox or any other storage
mechanism. Neither Macmillan Publishers Limited nor any of its agents accept
liability for any statements made which are clearly the sender's own and not
expressly made on behalf of Macmillan Publishers Limited or one of its agents.
Please note that neither Macmillan Publishers Limited nor any of its agents
accept any responsibility for viruses that may be contained in this e-mail or
its attachments and it is your responsibility to scan the e-mail and attachments (if any). No contracts may be concluded on behalf of Macmillan Publishers Limited or its agents by means of e-mail communication. Macmillan Publishers Limited Registered in England and Wales with registered number 785998 Registered Office Brunel Road, Houndmills, Basingstoke RG21 6XS ********************************************************************************


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


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



Reply via email to