Customizing messages

267 views
Skip to first unread message

Teddy Brown

unread,
Apr 9, 2018, 3:26:02 PM4/9/18
to CAS Community
Hi,
We recently found need to customize a handful of messages in messages.properties. 

We use the CAS Maven overlay template from GitHub.  To override messages on 5.0 we took the source messages.properties file and placed it in src/main/resources which works.  Recently we updated to 5.2, I just recently noticed a handful of messages missing.

Is there a way we can override just the messages we want without the entire messages.properties file?  Otherwise it seems when we update we will have to manually verify that there are no missing messages.

Thanks

Misagh Moayyed

unread,
Apr 9, 2018, 3:35:58 PM4/9/18
to cas-...@apereo.org
Take a look here:

custom_messages.properties should do the job, IIRC. 

--Misagh


--
- Website: https://apereo.github.io/cas
- Gitter Chatroom: https://gitter.im/apereo/cas
- List Guidelines: https://goo.gl/1VRrw7
- Contributions: https://goo.gl/mh7qDG
---
You received this message because you are subscribed to the Google Groups "CAS Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cas-user+u...@apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/80dc348a-36cd-4026-adcd-f5c1d020d1c0%40apereo.org.

Teddy Brown

unread,
Apr 9, 2018, 3:47:09 PM4/9/18
to CAS Community, mmoa...@unicon.net
Will those override the ones specified in messages.properties?

For instance, if I want to override one specific message:

screen.success.success=You, <strong>{0}</strong>, have successfully logged into the Central Authentication Service. However, you are seeing \
  this page because CAS does not know about your target destination and how to get you there. Examine the authentication request again and \
  make sure a target service/application that is authorized and registered with CAS is specified.

Do I put this in custom_messages.properties?

Currently we copied the whole messages.properties but I'd rather override specific messages.

David Curry

unread,
Apr 9, 2018, 4:39:25 PM4/9/18
to cas-...@apereo.org, Misagh Moayyed
Yes, you can override individual messages in messages.properties by putting them in custom_messages.properties with new values.

You can also define completely new messages in there as well, and reference them with Thymeleaf in the page templates, using the same syntax as used for the "standard" properties..

Just create <maven overlay root>/src/main/resources/custom_messages.properties and
it'll get picked up on your next "mvnw clean package".

--Dave


--

DAVID A. CURRY, CISSP
DIRECTOR OF INFORMATION SECURITY
INFORMATION TECHNOLOGY

71 FIFTH AVE., 9TH FL., NEW YORK, NY 10003
+1 212 229-5300 x4728david...@newschool.edu

The New School


To unsubscribe from this group and stop receiving emails from it, send an email to cas-user+unsubscribe@apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/9efadb65-d86e-4f3e-8e8f-5a4b4da929a9%40apereo.org.

Reply all
Reply to author
Forward
0 new messages