Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/spring-mvc/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring mvc spring引导中自定义404错误页面中的请求url_Spring Mvc_Spring Boot_Thymeleaf - Fatal编程技术网

Spring mvc spring引导中自定义404错误页面中的请求url

Spring mvc spring引导中自定义404错误页面中的请求url,spring-mvc,spring-boot,thymeleaf,Spring Mvc,Spring Boot,Thymeleaf,在Spring Boot 1.5.1/SpringMVC with Thymeleaf中,我在/resources/templates/error/中创建了一个自定义的404.html错误页面,如果用户访问的url不是由任何控制器处理的,则显示该404.html页面 我还注意到,我可以通过执行以下操作来显示时间戳、状态(404)和错误(未找到): <ol> <li>Timestamp: <p th:text="${timestamp}">timestam

在Spring Boot 1.5.1/SpringMVC with Thymeleaf中,我在/resources/templates/error/中创建了一个自定义的404.html错误页面,如果用户访问的url不是由任何控制器处理的,则显示该404.html页面

我还注意到,我可以通过执行以下操作来显示时间戳、状态(404)和错误(未找到):

<ol>
   <li>Timestamp: <p th:text="${timestamp}">timestamp</p></li>
   <li>Status: <p th:text="${status}">status</p></li>
   <li>Error: <p th:text="${error}">error</p></li>
</ol>

  • 时间戳:

    Timestamp

  • 状态:

    状态

  • 错误:

    错误


  • 如何显示导致404错误的请求(无效)URL?

    以及为什么spring batch包含在一组标记中?@OleksandrShpota应该是spring boot,抱歉。@user1583209使用此选项