【发布时间】:2016-11-09 15:36:20
【问题描述】:
我正在向 Spring Boot 项目添加自定义错误页面,我很好奇除了创建一个新的 error.html 页面之外,我是否需要做任何其他事情。
我显然希望页面针对不同的消息进行更改。但我注意到(偶然)<h1 th:text="#{error.status_code}">404</h1> 之类的东西返回给我??error.status_code_en_US??。我假设是 status_code 但不是以可读的方式或其他方式?是否有可能仅从 error.html 页面中获取?
还有一些……
<p th:text="#{error.exception}">Default Error Message</p>
<p th:text="#{error.exception_type}">Default Error Message</p>
<p th:text="#{error.request_uri}">Default Error Message</p>
<p th:text="#{error.servlet_name}">Default Error Message</p>
生成:
??error.exception_en_US??
??error.exception_type_en_US??
??error.request_uri_en_US??
??error.servlet_name_en_US??
【问题讨论】:
标签: html spring spring-boot thymeleaf