2016-09-04 5 views
1

私はSpring BootとThymeleafで本当に新しく、Spring Securityを実装しているサンプルプロジェクトに取り組んでいます。私はまた、私のプロジェクトにThymeleaf Security Dialectを使いたいと思っています。私が読んでいるように、Spring Bootの場合にはSecurity Dialectの設定を作成する必要はありません。 最初に達成したいのは、ビューにログインしているユーザーを表示することです。私はこれがビューにDIV追加SpringBoot + Thymeleaf + Security Dialect設定方法は?

を::

<div sec:authentication="name"> 
     The value of the "name" property of the authentication object should appear here. 
    </div> 

とのpom.xmlにdependecyを追加しました:

<!-- https://mvnrepository.com/artifact/org.thymeleaf.extras/thymeleaf-extras-springsecurity4 --> 
<dependency> 
    <groupId>org.thymeleaf.extras</groupId> 
    <artifactId>thymeleaf-extras-springsecurity4</artifactId> 
    <version>3.0.0.RELEASE</version> 
</dependency> 

誰もが任意のアイデアを持っている場合は、私を聞かせてください、私がこれまで行ってきた何 知っている。

答えて

1

私はこの問題を解決しました。解決策が見つかりました。 thymeleaf-extras-springsecurity43.0.0.RELEASEバージョンを使用しています。 2.1.2.RELEASEでうまく動作します。

関連する問題