根据博客教程 http://blog.didispace.com/springbootexception/ 编写demo,启动应用访问 http://localhost:8080/hello 报错:
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.thymeleaf.exceptions.TemplateProcessingException: Exception evaluating SpringEL expression: "exception.message" (error:10)
Caused by: org.thymeleaf.exceptions.TemplateProcessingException: Exception evaluating SpringEL expression: "exception.message" (error:10)
Caused by: org.springframework.expression.spel.SpelEvaluationException: EL1007E: Property or field 'message' cannot be found on null
解决办法:在Contoller中要添加一个抛出异常:
版权声明:本文为u014071434原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。