【发布时间】:2017-10-16 19:32:30
【问题描述】:
我想根据区域设置国家选择一个选择框的选项,但没有办法。 我试过了:
<option value="AR" th:selected="${#locale.country.contains('AR')}" >Argentina</option>
<option value="AR" th:selected="${#locale.contains('AR')}" >Argentina</option>
<option value="AR" th:selected="${__${#locale}__.contains('AR')}" >Argentina</option>
<option value="AR" th:selected="${#{__${#locale}__}.contains('AR')}" >Argentina</option>
此选项显示国家/地区(美国)
<option value="US" th:text="${#locale.country}" th:selected="${#locale.country == 'US'}" >United States</option>
但是这个选项没有被选中。
【问题讨论】:
标签: html spring spring-mvc spring-boot thymeleaf