User-Interface-Customization

99 views
Skip to first unread message

Satnam Sarai

unread,
Feb 5, 2018, 2:56:55 PM2/5/18
to CAS Community
Hello,

Is it possible to read value from cas.properties in .html views?  in 4.2.x, we are reading two links from cas.properties file and creating link in casLoginView.jsp. 

thanks

Man H

unread,
Feb 5, 2018, 3:42:09 PM2/5/18
to cas-...@apereo.org
depends on if those properties are defined to be accessed from thymeleaf in cas.

http://www.thymeleaf.org/doc/articles/springmvcaccessdata.html


--
- 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+unsubscribe@apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/c686221b-203b-42e5-b16a-6c3c7ba2202a%40apereo.org.

Man H

unread,
Feb 5, 2018, 3:46:30 PM2/5/18
to cas-...@apereo.org

2018-02-05 17:42 GMT-03:00 Man H <info.i...@gmail.com>:
depends on if those properties are defined to be accessed from thymeleaf in cas.

http://www.thymeleaf.org/doc/articles/springmvcaccessdata.html

2018-02-05 16:56 GMT-03:00 Satnam Sarai <satna...@gmail.com>:
Hello,

Is it possible to read value from cas.properties in .html views?  in 4.2.x, we are reading two links from cas.properties file and creating link in casLoginView.jsp. 

thanks

--
- 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.

Satnam Sarai

unread,
Feb 5, 2018, 5:07:32 PM2/5/18
to CAS Community
thanks that is helpful.


I placed two URLs in messages.properties file and I was able to access those in HTML.  Is it possible to externalize the messages.properties? Or there is another better way to do this? I don't want to compile different version for dev, staging and production sites.  Currently, our CAS.properties file is externalize.

screen.pm.button.forgotpwd=Forget your password? <a href="https://localhost:8030/">Reset it</a>
screen.button.createAccount=<a href="https://localhost:8031/">Create Account </a>


<span th:utext="#{screen.button.createAccount}"/>
<span th:utext="#{screen.pm.button.forgotpwd}"/>

Man H

unread,
Feb 5, 2018, 5:34:42 PM2/5/18
to cas-...@apereo.org
you could use this
cas.messageBundle.commonNames=classpath:/common_messages.properties,file:/etc/cas/config/common_messages.properties


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/3e23b666-125e-40a0-a198-d759cf90edf6%40apereo.org.

Andy Ng

unread,
Feb 5, 2018, 11:42:50 PM2/5/18
to CAS Community
Hi,

When I need to read stuff from properties file, I use this:

https://stackoverflow.com/questions/21726119/how-to-access-system-properties-in-thymeleaf-template

${@environment.getProperty('myPropertyName')}
I use it something like this:
<script language="javascript" th:src="@{'https://'+ ${@environment.getProperty('mysite.host.someaddress')} +'/js/myscript.js'}"></script>

See if that fit your needs?

- Andy
Reply all
Reply to author
Forward
0 new messages