velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nathan Bubna" <nbu...@gmail.com>
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

$!URLEncoder.encode($cf.getValue($issue))


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 <qpan@army.com> 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: http://www.nabble.com/How-to-call-a-Java-method-with-params-from-velocity--tp20789552p20953403.html
> Sent from the Velocity - User mailing list archive at Nabble.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


Mime
View raw message