A little help with messages.properties

Wessel, Keith kwessel at illinois.edu
Thu Feb 10 16:26:17 UTC 2022


Figured it out. The echoing the values were the clue I needed, thanks for that. I was overlooking this key line in error.vm:

#set ($eventKey = $springMacroRequestContext.getMessage("$eventId", "error"))

That's the magic that maps ContextCheckDenied to context-check-denied. So, to keep from having to repeat the entity ID over and over again in the title, header and message properties, I added this to the beginning of my if block:

#set ($eventKey = $springMacroRequestContext.getMessage("${eventId}-${entityId}", "error"))

Now, it matches ContextCheckDenied-https://sp.example.illinois.edu/shibboleth mapping to a friendlier sp-example-context-check-denied.

I can, of course, make this whole thing simpler if I'm willing to have uglier property names. But none of this is simple in the first place. 😊

Thanks, Scott.

Keith

-----Original Message-----
From: users <users-bounces at shibboleth.net> On Behalf Of Cantor, Scott
Sent: Thursday, February 10, 2022 7:14 AM
To: Shib Users <users at shibboleth.net>
Subject: Re: A little help with messages.properties

On 2/9/22, 10:51 PM, "users on behalf of Wessel, Keith" <users-bounces at shibboleth.net on behalf of kwessel at illinois.edu> wrote:

>    I sort of assumed that this assignment then gets passed on. For instance, I define context-check
>-denied.message in my messages.properties, not ContextCheckDenied.message.

That's all based on what's in the default error.vm file, it's just a convention I used as an example of how to organize messages. There's no entityID component in there, let alone a shortened version of one.

>    And am I also correct that I need to escape the colon?

In Java property keys, yes.

-- Scott


-- 
For Consortium Member technical support, see https://urldefense.com/v3/__https://shibboleth.atlassian.net/wiki/x/ZYEpPw__;!!DZ3fjg!t8CM1B5cgpdbaKVv9B_ugMHWb6NaZadZoR_G3WC98Uyb0vPtd3ccDuka2Ip898MK-A$ 
To unsubscribe from this list send an email to users-unsubscribe at shibboleth.net


More information about the users mailing list