Velocity code not rendering in error.vm

Wessel, Keith kwessel at illinois.edu
Tue Apr 11 16:33:06 EDT 2017


springContext sounds promising, but can I use it to pull in a variable that I'm defining on Jetty start-up with a java -Dfoo=bar arg? I can't see any easy way to do that with a blobal spring bean.

I'm starting to think that the easiest thing might be to skip displaying the IDP node name in my error template if $environment isn't defined. But I haven't give up yet.

Keith


-----Original Message-----
From: users [mailto:users-bounces at shibboleth.net] On Behalf Of Cantor, Scott
Sent: Tuesday, April 11, 2017 11:46 AM
To: Shib Users <users at shibboleth.net>
Subject: RE: Velocity code not rendering in error.vm

> Is there an easy way, when $environment isn't available, to get an external
> variable? Would I need to use the custom variable to pass in the needed
> class? I'm guessing, if environment isn't available, neither would be custom,
> and I'm a bit stumped how else I'd pull in that variable. Any hints appreciated.

I looked at the code, and I created a class that attempts to populate a few things of use through the MVC layer:

* request
* encoder
* springContext

The springContex variable in particular could probably get at global Spring beans by name.

More exotically, the class I built there (net.shibboleth.ext.spring.error.ExtendedMappingExceptionResolver) theoretically can take a function at build time that can dynamically add additional attributes to the view, but that isn't wired up at the moment. I suspect you can probably get enough done with the existing behavior.

And no, I didn't remember doing any of that when you first asked.

-- Scott

-- 
To unsubscribe from this list send an email to users-unsubscribe at shibboleth.net


More information about the users mailing list