logo       

HELP with Velocity Tools needed: msg#00180

jakarta.velocity.user

Subject: HELP with Velocity Tools needed

Hi,

I have used Velocity in a procejt about a year ago. Now I am creating a new
release of my software and try to port things to the latest versions of the
Apache software.

I have checked out Velocity tools from cvs and successfully built it with
Ant 1.5.1.

When I run my application it seems, that $link is not recognised! In a
Velocity macro I have the following code:

<form action=$link.setURI("$appRoot/authenticate.do") METHOD=POST >

I run it with Tomcat 4.1 and get the following 404 error:

type Status report

message /Echnaton/$link.setURI("$appRoot/authenticate.do")

description The requested resource
(/Echnaton/$link.setURI("$appRoot/authenticate.do")) is not available.


I have configured Velocity as follows:

In the web.xml of my application :

- <servlet>
<servlet-name>velocity</servlet-name>
<display-name>Velocity</display-name>
<description>The velocity template comiler.</description>

<servlet-class>org.apache.velocity.tools.view.servlet.VelocityViewServlet</s
ervlet-class>
- <init-param>
<param-name>toolbox</param-name>
<param-value>/WEB-INF/toolbox.xml</param-value>
</init-param>
- <init-param>
<param-name>properties</param-name>
<param-value>/WEB-INF/config/velocity.properties</param-value>
</init-param>
<load-on-startup>4</load-on-startup>
</servlet>

And this is my toolbox.xml:

<?xml version="1.0" ?>
- <toolbox>
- <tool>
<key>toolLoader</key>
<class>org.apache.velocity.tools.generic.ToolLoader</class>
</tool>
- <tool>
<key>link</key>
<class>org.apache.velocity.tools.view.tools.LinkTool</class>
</tool>
- <tool>
<key>msg</key>
<class>org.apache.velocity.tools.struts.MessageTool</class>
</tool>
- <tool>
<key>date</key>
<scope>application</scope>
<class>org.apache.velocity.tools.generic.DateTool</class>
</tool>
- <tool>
<key>errors</key>
<class>org.apache.velocity.tools.struts.ErrorsTool</class>
</tool>
- <tool>
<key>form</key>
<class>org.apache.velocity.tools.struts.FormTool</class>
</tool>
</toolbox>


Can anybody help me with my configuration problem?

Many thanks!

Thomas


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise