thymeleaf 解析错误

2020-09-14 14:00:40.393 ERROR 7960 --- [nio-8080-exec-5] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.thymeleaf.exceptions.TemplateInputException: An error happened during template parsing (template: "class path resource [templates/stupage/student.html]")] with root cause

org.springframework.expression.spel.SpelEvaluationException: EL1007E: Property or field 'username' cannot be found on null
	at org.springframework.expression.spel.ast.PropertyOrFieldReference.readProperty(PropertyOrFieldReference.java:213) ~[spring-expression-5.2.6.RELEASE.jar:5.2.6.RELEASE]
   model.addAttribute("student",student);

页面有如下的表达式 后台必须要有上述代码

  <a href="javascript:;">
                    [[${student.username}]]
                a>

你可能感兴趣的:(springboot,spring,boot)