the*_*ddy 1 java spring reactjs spring-boot
我有一个带有 React JS 客户端的 Spring Boot + Spring Security 应用程序。我想在其中有一个自定义样式的 404 错误页面,而不使用 Thymeleaf。
我的Spring Boot版本是2.0.0.M2
war文件结构是
root-dir
|- WEB-INF
| |- lib
| |- classes
| | |- static
| | | |- * (react dist)
| | |- * (other files)
|- org
|- META-INF
Run Code Online (Sandbox Code Playgroud)
我的 war 文件构建过程如下。
staticwar 目录中请帮我解决这个问题。
无需禁用白标签页。只需在src/main/resources/public/error目录下添加一个名为404.html的文件即可。
Baeldung.com 指示src/main/resources/public/errors,这不起作用,至少在 SpringBoot 2.1.x 中是这样。使用单一错误,你就会很好。
所有这些工作都不需要项目依赖项中的任何模板引擎。
| 归档时间: |
|
| 查看次数: |
1103 次 |
| 最近记录: |