Closed jonaskahn closed 4 weeks ago
Hi
The asset handler by default generates a silent 404
response. Try this:
assets(
"/*", AssetHandler("404.html", www)
.setMaxAge(Duration.ofDays(365))
)
So, I want to set custom error for 500, 404, 403. Therefore, I seem can not apply this.
Btw, I am using SPA page, I change to default fallback to index.html
, then it works like what I expected.
Got it. We can change asset handler to throw an exception instead. Meanwhile you can try this:
null
you throw the error you want so error handler catch and handle it.Got it. We can change asset handler to throw an exception instead. Meanwhile you can try this:
- create your own AssetSource that delegates to another asset source, so when asset is
null
you throw the error you want so error handler catch and handle it.
I see. I'll try that, thank you.
I want to make a customized handler to handle 404 error, when error happen, send back 404 page Here is my implementation
I tried with
sendRedirect
orforward
, but it does not work. Could you show me the way to send a html page for 404 error?