How to set default error page for WildFly server?
I am using Wildlfy Application Server 8.2.0.Final. I deployed the app.war file. In app web.xml, I can specify home and error pages. Which works great for
url and for invalid urls relative to it. When I type something like
I see the specified page - that's great.
But when I enter
I can see the default WildFly page and when I print the wrong one
404 - Not Found
I would like to use the same welcome and error pages from my application for these urls. I found a reasonable solution for the welcome page here: How to automatically navigate to "my web app" from the "root (/)" context in JBoss? which works great, but I couldn't find out what I can do about the errors.
Zigac's solution works great and my "manual" solution works, but there is still a problem:
What to do with
url - am I still getting the default error for the server even though the url is under the root of the application?
source to share
I changed the localhost alias setting for the WildFly HTTP server and specified my war in the app instead of the default root.war. This solution, as opposed to the one redirecting to my app url from the default app server index.html (in the greeter-content directory), allows all linked urls "/" to be interpreted as links linked to my app. and thus the provided display of error pages from app.war web.xml works fine for all invalid urls.
I used the WildFly admin console (9090) to change the HTTP server settings: Configuration -> Web-> HTTP-> Hosts-> Default web module.
source to share