<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
<br>
<div class="moz-cite-prefix">On 2/3/16 2:33 PM, Wessel, Keith wrote:<br>
</div>
<blockquote
cite="mid:A1EB7EC659FA0F429A55865D5820006D2E4211A6@CITESMBX1.ad.uillinois.edu"
type="cite">
<pre wrap="">Thanks, Scott. An excellent enhancement. I wondered exactly what the "custom" variable meant at the top in the comments.
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. 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").
What am I doing wrong?
</pre>
</blockquote>
<br>
<br>
The bean is exposed in the template as a variable called "custom".
[1] For some detailed discussion and examples, see the original
Jira issue. [2]<br>
<br>
Since in this case the custom object is a Map, if you defined an
entry in the map with key "foo", you reference in the Velocity
template like:<br>
<br>
<tt>$custom.get("foo")</tt><br>
<br>
and Velocity supports some syntactic sugar variations for some
types, like lists arrays and maps:<br>
<br>
<tt>$custom["foo"]</tt><br>
<br>
Full usage possibilities you can glean from the Velocity user guide
docs. [3]<br>
<br>
<br>
[1]
<a class="moz-txt-link-freetext" href="https://wiki.shibboleth.net/confluence/display/IDP30/VelocityVariables">https://wiki.shibboleth.net/confluence/display/IDP30/VelocityVariables</a><br>
[2] <a class="moz-txt-link-freetext" href="https://issues.shibboleth.net/jira/browse/IDP-774">https://issues.shibboleth.net/jira/browse/IDP-774</a><br>
[3]
<a class="moz-txt-link-freetext" href="https://velocity.apache.org/engine/releases/velocity-1.7/user-guide.html">https://velocity.apache.org/engine/releases/velocity-1.7/user-guide.html</a>
<br>
<br>
<br>
<br>
</body>
</html>