我使用春节安全与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