Pulling an env var or Java variable into a view in V3

Brent Putman putmanb at georgetown.edu
Fri Jun 12 18:38:53 EDT 2015



On 6/12/15 5:22 PM, Wessel, Keith wrote:
> I’m going to apologize in advance if this is a dumb question. I’m in the process of moving our login page from login.jsp in V2 into the spiffy new views in V3. I’ve worked with views a bit, but I’m no pro.
>
> In our current setup, we display a rather inconspicuous note at the bottom of the login and error pages telling the user which IDP node they’re on. Helps us find login errors in the logs when they send us a screenshot. I used to do this by pulling in the system hostname and displaying it in my jsp code. Recently, I changed that to passing it to the jvm at start-up to give me more control over how it got displayed: -DidpNodeName=$node_hostname. It was nice either way because the IDP code could be the same on all cluster nodes and only the shell script was changed. It was in my .profile, so not even the tomcat start script had to differ.
>
> Is there an easy way to pull something similar into the new login.vm? 


I haven't tested yet, but I believe you could use the Spring
Environment instance that is exposed.  The PropertySources installed by
default pull from both system properties and environment variables.

>From the variables list at top of login.vm:

## environment - Spring Environment object for property resolution



So you might just try something like:

$environment.getProperty('idpNodeName')




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://shibboleth.net/pipermail/users/attachments/20150612/d7c5b6eb/attachment-0001.html>


More information about the users mailing list