Rodrigo,

Spring's PropertyResolver, 
https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/core/env/PropertyResolver.html,
 does not provide a list option. It does allow you to specify a type. I am not 
sure how you would set a list in a text file.
Based on Andy's example, I think you are overriding the properties.
resources:
  name: name1
  link: link1
  name: name2
  link: link2
will become 'resources.name' and 'resources.link'. The '.' or ':' notation ends 
up being part of the property key. Not like a pseudo class of member variables. 
The end result is:
resources.name == name2
resources.link == link2

I do not know much about thyme leaf so this example is pure speculation. Maybe 
there is a variable processing tag if the below does not work.
Perhaps you could do something with a comma separated list:
resources:
  name1,link1,name2,link2
and then (providing an empty string as a default value):
  th:each="resource : ${split(',', @environment.getProperty('resources', ''))}"

Ray

On Wed, 2019-02-20 at 06:30 -0800, Rodrigo Siqueira wrote:
Hello guys,

I'm trying to read a list of complementary resources from my application.yml 
file.
I've tried doing this, which should create repeated "Test" links on login view, 
but it doesn't works...
Any help is appreciated, thanks




<li class="list-group-item" th:each="resource : 
${@environment.getProperty('resources')}">
    <a th:inline="text">
        Test
    </a>
</li>


resources:
  - name: name1
    link: /name1
  - name: name2
    link: /name2


--
Ray Bon
Programmer analyst
Development Services, University Systems
2507218831 | CLE 019 | [email protected]

-- 
- 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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/a/apereo.org/d/msgid/cas-user/1550854409.4523.54.camel%40uvic.ca.

Reply via email to