我使用春節安全與HTML頁面使用百里香。我必須用「秒:授權」問題屬性在這種情況下:春季安全使用「如果」情況下的百里香
<ul class="nav nav-tabs margin15-bottom">
<li th:each="criteriaGroup,iterGroups : ${aGroupList}"
th:class="${iterGroups.index == 0}? 'active'"><a
th:href="'#' + ${criteriaGroup.id}" data-toggle="tab"
th:text="${criteriaGroup.groupName}"></a></li>
</ul>
現在我要像添加彈簧安全特性:如果我有這個特別的標準,我需要一個授權(SEC:授權=「hasRole(‘標準’)」),雖然我不會看到對應於這個標準的標籤:
<ul class="nav nav-tabs margin15-bottom">
<li th:each="aGroup,iterGroups : ${aGroupList}"
th:sec:authorize="$({criteriaGroup.id =='criteriaA'} || ${criteriaGroup.id =='criteriaB'}) ? 'hasRole('Criteria')'"
th:class="${iterGroups.index == 0}? 'active'"><a
th:href="'#' + ${criteriaGroup.id}" data-toggle="tab"
th:text="${criteriaGroup.groupName}"></a></li>
</ul>
但是,當我這樣做,我有以下錯誤:
org.thymeleaf.exceptions.TemplateProcessingException: Error processing template: dialect prefix "th" is set as non-lenient but attribute "th:sec:authorize" has not been removed during process
哪有我避開它?
使用#authentication身份表達似乎並不在默認情況檢查空。 – aalmero