Externalizing custom messages

36 views
Skip to first unread message

Dustin J Luck

unread,
Jan 29, 2020, 3:33:28 PM1/29/20
to CAS Community
I am trying to externalize as many of the customizations to CAS as possible. I have figured out how to do so for UI templates using the cas.view.templatePrefixes[0] property, but am having trouble figuring out a similar technique for custom_messages.properties. I tried using the cas.messageBundle.baseNames property as described in this thread, but couldn't get that to work. Am I missing something or is there another method I should try?

Actual property value set
cas.messageBundle.baseNames = file:/etc/cas/messages,classpath:custom_messages,classpath:messages

File location on server:
c:\etc\cas\messages\custom.messages.properties


If it isn't possible to externalize custom messages, what are the downsides to including my customized text as literals in the UI templates rather than bringing them in as custom messages?


Thanks


My environment:
  • Standalone CAS 6.0.5 build
  • Windows Server 2012 R2
  • Tomcat 9 running as a service

Ray Bon

unread,
Jan 29, 2020, 7:10:56 PM1/29/20
to cas-...@apereo.org
Dustin,

Should your file be custom_messages.properties (note '_')?

Then maybe cas.messageBundle.baseNames = file:/etc/cas/messages/custom_messages,classpath...

You could also put your custom file in src/main/resources/ and it will end up in the classpath (would this negate setting cas.messageBundle.baseNames?).

Ray
-- 
Ray Bon
Programmer Analyst
Development Services, University Systems

I respectfully acknowledge that my place of work is located within the ancestral, traditional and unceded territory of the Songhees, Esquimalt and WSÁNEĆ Nations.

Dustin J Luck

unread,
Jan 30, 2020, 5:10:13 PM1/30/20
to CAS Community
Thanks, Ray. That did the trick. The dot in the file name was a typo; my custom_messages file was named properly. I just needed to fix the value for file.
Reply all
Reply to author
Forward
0 new messages