Description
Affects: 5.3.8
The problem was previously discussed in #21328, but as @danbim pointed out, it's not a reliable solution as it overrides other routes in the application.
I tried to annotate the static resource bean with @Order(Ordered.LOWEST_PRECEDENCE)
, but that seems to only make it the lowest of the annotated beans, not lowest of all beans like it would need to be for this to work. I checked the documentation for ways to specify a custom error page instead of the white label one, and the only thing I could find was a static 404.html
file, but as far as I can tell there is no way to change the status to 200
.
This has been asked for countless of times on StackOverflow and similar places, and the answers range from completely wrong to completely ridiculous, like using regexes or explicit routes to catch everything that the front end might conceivably want to handle.
I'm suggesting that Spring as a back-end for SPAs is a common enough use case to warrant a reliable solution.