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

Popular posts from this blog

html - Difficulties with background-image property -

visual studio code - What does the isShellCommand property actually do and how should you use it? -

ios - Segue not passing data between ViewControllers -