【问题标题】:Running ReactJs with SpringBoot. Reload page error WhiteLabel 404使用 SpringBoot 运行 ReactJs。重新加载页面错误 WhiteLabel 404
【发布时间】:2023-04-01 00:55:01
【问题描述】:

使用 Spring Boot 运行 React 应用程序并重新加载页面时,会出现白标错误。

我运行 npm rum build 并将内容复制到资源/静态文件夹。在构建并运行spring应用程序后,它通常加载localhost:8080,但是当它重新加载页面时它返回错误

白标错误页面 此应用程序没有明确的 /error 映射,因此您将其视为后备。

2020 年 6 月 15 日星期一 20:23:56 BRT 出现意外错误(类型=未找到,状态=404)。 没有可用的消息

我刚刚在 spring 中创建了应用程序,并将 build 文件夹从 react 复制到 spring 的资源/静态。我应该如何进行?

【问题讨论】:

  • 你是怎么解决这个问题的?

标签: reactjs spring-boot react-router http-status-code-404


【解决方案1】:

一种对我有用的可能解决方案:切换到 HashRouting 而不是 BrowserRouting。

【讨论】:

猜你喜欢
  • 2023-03-13
  • 2020-09-22
  • 2017-10-06
  • 2018-10-05
  • 2020-02-01
  • 2019-04-02
  • 2018-07-22
  • 2018-10-21
  • 1970-01-01
相关资源
最近更新 更多