velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nathan Bubna" <>
Subject Re: How to call a Java method with params from velocity?
Date Thu, 11 Dec 2008 15:02:01 GMT
Can you not just do something like:

context.put("URLEncoder", new URLEncoder());

and then


If that doesn't work for some reason (private ctor or uncaught
exceptions), create your own simple "tool" class that you can create
an instance of, and add a method that calls URLEncoder.encode(String)
and does whatever else you need it to do.

On Thu, Dec 11, 2008 at 3:02 AM, kLy <> wrote:
> I've got another problem now. The tostring that it returns needs to be
> urlencoded. Is there an easy way this can be run?
> Java has the URLEncoder class but I won't know how to call this statically
> from Velocity if you even can.
> --
> View this message in context:
> Sent from the Velocity - User mailing list archive at
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message