Injecting Multiple customObject-refs

Cantor, Scott cantor.2 at osu.edu
Fri Aug 4 19:32:14 EDT 2017


On 8/4/17, 7:28 PM, "users on behalf of Klingenstein, Nate" <users-bounces at shibboleth.net on behalf of nklingenstein at calstate.edu> wrote:

> I have one MFA script and I need to insert both a shibboleth.AttributeResolverService and a  
> shibboleth.HttpServletRequest(evaluating both attributes and IP addresses for unholy reasons).
> 
> What’s the most elegant or intended way to do that?

Define a map bean containing them and inject the map.

<util:map id="MyMap">
   <entry key="servletRequest"><ref bean="shibboleth.HttpServletRequest" /></entry>
   <entry key="resolver"><ref bean="shibboleth.AttributeResolverService" /></entry>
</util:map>

...
custom["resolver"].resolveOrWhatever()

If you had a ton of these, it would be simplest to just build a big global map of needed beans and use it all over.

-- Scott




More information about the users mailing list