URL encoding the entity ID in Velocity

Cantor, Scott cantor.2 at osu.edu
Wed Feb 3 14:48:36 EST 2016


On 2/3/16, 2:33 PM, "users on behalf of Wessel, Keith" <users-bounces at shibboleth.net on behalf of kwessel at illinois.edu> wrote:



>I'm having some trouble getting it working. I've uncommented the block you mentioned in global.xml and set the key to urlEncoder, the value to java.net.URLEncoder.

You mean a bean of that class? You can't just set it to that string.

> I restarted Jetty to re-read global.xml. But when I put $urlEncoder.encode("$entityID", "utf-8") in my login.vm, Velocity gives me back a literal string. Same for when I make it $custom.urlEncoder.encode("$entityID","utf-8").

$urlEncoder isn't defined. $custom is the only thing defined. If you make $custom a map, then you have the ability to access multiple named objects, but it's still a map, you have to call $custom.get(key)

-- Scott



More information about the users mailing list