Hi Markus, You've almost got things right. The ParameterParser is used for parsing the parameters of the current ServletRequest. This means you must have it as a request-scoped tool. When you try to put it as an application-scoped tool, then the wrong thing is sent to the init() method and the tool complains.
Also, $params.getString is not the proper way to use the tool. You need to specify which request parameter you wish to get: $params.getString('foo') You can also simplify that by just doing $params.foo if you don't need to parse the parameter and just want it as a string. -nathan On 12/21/06, Markus Auchmann <[EMAIL PROTECTED]> wrote:
Hi guys, I downloaded the tools and tried the example provided with the package (simple - servlet). It works fine. Now I want to get the parameter out of the url to work with it in velocity. I think the right tool for it is the ParameterParser (if not please tell me how to get the parameters out of the url). So I did the following: I added this to my toolbox.xml: <tool> <key>params</key> <scope>application</scope> <class>org.apache.velocity.tools.view.tools.ParameterParser</class> </tool> And this to my template: Parameter tool: $params.getString But when starting up tomcat I get various failures (the date tool for example is working properly): [...] Problem loading toolbox '/WEB-INF/toolbox.xml': java.lang.IllegalArgumentException: Was expecting interface org.apache.velocity.tools.view.context.ViewContext or interface javax.servlet.ServletRequest [...] Do I have to download this tool to use it or should it be provided with the tools-1.2 anyway? Thanks in advance, markus --------------------------------------------------------------------- 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]