org.thymeleaf.exceptions.TemplateProcessingException
来源:5-3 权限控制
慕函数4411803
2018-02-04
你好老师,
提示这个错误,解决不了,求助。
org.thymeleaf.exceptions.TemplateProcessingException: Exception evaluating SpringEL expression: "session.SPRING_SECURITY_CONTEXT.authentication.principal.username" (template: "common" - line 45, col 43)
org.springframework.expression.spel.SpelEvaluationException: EL1008E: Property or field 'username' cannot be found on object of type 'java.lang.String' - maybe not public?
写回答
1回答
-
瓦力老师
2018-02-05
亲,建议检查下你建立的principle对应类,课程中是User,是否有username字段,另外,确保继承了正确的UserDetails类哈。祝亲学习愉快^O^
112018-02-05