html - How to store URLs in properties file and access them in templates using Spring and Thymeleaf -
i trying create simple navigation bar links other websites/servers using spring boot , thymeleaf. want store these urls in 'application.properties' , access them via th:href. when try access them, not redirecting me url.
here html:
<li class="dropdown-submenu"> <a tabindex="-1" href="#">menu</a> <ul class="dropdown-menu"> <li><a th:href="#{foo.bar}">selection 1</a></li>
in application.properties:
foo.bar=http://www.example.com
it turns out notation works:
<li class="dropdown-submenu"> <a tabindex="-1" href="#">menu</a> <ul class="dropdown-menu"> <li><a th:href="@{${@environment.getproperty('foo.bar')}}>selection 1</a></li>
Comments
Post a Comment