The global web.xml is located at server/xxx/deployers/jbossweb.deployer, you can specify them there. And you will probably want to place the HTML pages in server/xxx/deploy/ROOT.war.
P.S. You never said with version of JBoss AS so I assume the latest (5.x).
Thank you for the reply. I am using version 4.2.3 and I have successfully added the error-page tag in web.xml in
When I go to http://host:8080/blablah, I see the customized 404 page.
However, when I go to http://host:8080/app1/blablah or http://host:8080/app2/blablah, etc, I get the standard JBoss error.
I think I am almost there, and missing an obvious step, but easy step ... any ideas?
Wrong web.xml file - the one you edited is specific to the ROOT application. You need to edit the global web.xml file. In 4.2.x it is located at server/xxx/deploy/jboss-web.deployer/conf.
I've added this line in server/xxx/deploy/jboss-web.deployer/conf/web.xml:
and added the 404.html file in ROOT.war, with partial success.
http://host:8080/blablah - returns correct 404 page
http://host:8080/app1/blablah - returns a blank page ...
What might be causing the blank page? I don't see anything unusual in the log files ... hmm ... /-:
So there is no way to configure the error pages in one central place have them take effect for all other applications? Just confirming ...
If there is a way, the global web.xml is not it. Think of it this way - the configuration for a web app is the combination of the contents of the global web.xml and the web.xml specific to that app. Thus to get the 404 page for app1, you would have to place a copy of 404.html into app1.war (though you do not need to add anything to the web.xml for app1 - the global web.xml declaration is sufficient.) But this still would not work if the user entered a bad context name (for example http://hostname:8080/nosuchapp/aaa) - that would still give the app server's built in error message.
There is probably a way of using a filter, or some other mechanism, to do this, however. Perhaps someone knows off-hand.