I am using Spring MVC and Spring Security version 3.0.6.RELEASE. What is the easiest way to get the user name in my JSP? Or even just whether or not the user is logged in? I
For accessing a principal attribute use, first, create a variable for attributes:
Then, you can use this map for retrieving values by the attribute key name:
${principalAttr.get("given_name")}
Do not forget to add spring security taglib in your maven dependencies list:
org.springframework.security
spring-security-taglibs
5.3.4.RELEASE