亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如何解決這個問題:評估 SpringEL 表達式的異常

如何解決這個問題:評估 SpringEL 表達式的異常

慕桂英546537 2021-11-11 17:42:10
我正在開發實現 spring 安全性的簡單項目。當我嘗試使用Spring和Thymeleaf 的注銷鏈接時,問題就出現了。1.pom.xml    <!--Spring Boot Dependencies  - Security -->    <dependency>        <groupId>org.springframework.boot</groupId>        <artifactId>spring-boot-starter-security</artifactId>    </dependency>    <!-- Dependencies Spring Security-->    <dependency>        <groupId>org.thymeleaf.extras</groupId>        <artifactId>thymeleaf-extras-springsecurity4</artifactId>        <version>2.1.2.RELEASE</version>        <scope>compile</scope>    </dependency>導航欄.html<ul class="nav navbar-nav navbar-right">                <!--<li><a th:href="@{/login}" th:text="#{navbar.login.text}"></a></li>-->                <li th:if="${#authorization.expression('isAuthenticated()')}">                    <a th:href="@{/login}" th:text="#{navbar.login.text}"/>                </li>                <li th:if="${#authorization.expression('isAuthenticated()')}">                    <form id="f" th:action="@{/logout}" method="post" role="form" class="navbar-form">                        <button type="submit" th:text="#{navbar.logout.text}" class="btn btn-primary"/>                    </form>                </li>            </ul>錯誤截圖:
查看完整描述

1 回答

?
心有法竹

TA貢獻1866條經驗 獲得超5個贊

當 Thymeleaf Extras Spring Security 版本與 Spring Framework 版本不兼容時會發生此錯誤,在這種情況下,Spring Boot 版本適用于 Spring Framework 5.x 版,而您擁有的 Thymeleaf Extras Spring Security 版本是 4.x。您需要更新 pom.xml 中的 artifactId 并選擇兼容版本或讓 Spring Boot 為您選擇版本


<dependency>

    <groupId>org.thymeleaf.extras</groupId>

    <artifactId>thymeleaf-extras-springsecurity5</artifactId>

    <scope>compile</scope>

</dependency>


查看完整回答
反對 回復 2021-11-11
  • 1 回答
  • 0 關注
  • 370 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號