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

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

How to show in django cms breadcrumbs full path? -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -