I created a new project that uses springboot 2.0.5.RELEASE and its associated spring-boot-starter-security and spring-boot-starter-thymeleaf. Just like this:
I want to display the user name that is currently logged in on the thymeleaf-based html page. According to the information I found, I should add the following content to the html page
<span sec:authentication="name">Bob</ Span>
However, after opening the corresponding page, the sec:authentication tag displayed in the navigation console is not parsed correctly, because it is still "the original look".
I found that I should add thymeleaf-extras-springsecurity X to the pom.xml file. But I can only get the thymeleaf-extras-springsecurity4 dependency, not thymeleaf-extras-springsecurity5 Dependence.
There are no search results in the central maven repository, and when I use
I created a new project that uses
springboot 2.0.5.RELEASE
and its associatedspring-boot-starter-security
andspring-boot-starter-thymeleaf
. Just like this:I want to display the user name that is currently logged in on the thymeleaf-based html page. According to the information I found, I should add the following content to the html page
However, after opening the corresponding page, the
sec:authentication
tag displayed in the navigation console is not parsed correctly, because it is still "the original look".I found that I should add
thymeleaf-extras-springsecurity X
to thepom.xml
file. But I can only get thethymeleaf-extras-springsecurity4
dependency, notthymeleaf-extras-springsecurity5
Dependence. There are no search results in the central maven repository, and when I useor
can't download dependencies.
So, what should I do now to make my page display the username?