-
1. Re: configuring custom error pages across all vhosts
jaikiran Nov 18, 2008 8:36 AM (in response to brettcave)Maybe i am missing something, but isn't the error page mapping in the web.xml independent of virtual hosts? What i mean is as long as you configure your web.xml correctly to map the error codes to custom error pages, it does not matter whether you have virtual host configured for the application. Maybe i am wrong. Could you please post the contents of your web.xml? And does the custom error page redirection, currently work without any additional changes.
-
2. Re: configuring custom error pages across all vhosts
brettcave Nov 19, 2008 12:10 PM (in response to brettcave)Here is some testing I have done.
There are 3 ways to access the application server:
1) named vhost which is actually an apache server with mod_jk (http://vhost/). /myapp/*, /anotherapp/* and *.jsp are jkMounted.
2) default vhost via apache and mod_jk (http://nonvhost/)
3) direct to jboss (http://jboss:8080/) on default vhost.
the names I have used in brackets are for reference purposes in this post.
I have 3 contexts that I access:
A) Default context, with no app deployed to it besides the default jboss-web.deployer (i.e. ROOT.war).
B) myapp-ear.ear is deployed to context /myapp/ (context-root="myapp") and to the named vhost
C) anotherapp is deployed to context /anotherapp/ on the default vhost (no vhost specification in jboss-web.xml)
web.xml for jboss-web.deployer has the following:
<error-page>
<error-code>404</error-code>
/error/404.html
</error-page>
None of the web.xml files for app B) and C) have any error directives in them.
The results are as follows:
1) + A) http://vhost/nopage.jsp - custom error page
1) + B) http://vhost/myapp/nopage - default error
1) + C) http://vhost/anotherapp/nopage - blank page
2) + A) http://novhost/nopage.jsp - custom
2) + B) http://novhost/myapp/nopage - custom
2) + C) http://novhost/anotherapp/nopage - default
3) + A) http://jboss/nopage.jsp - custom
3) + B) http://jboss/myapp/nopage - custom
3) + C) http://jboss/anotherapp/nopage - default
why is 1) + C) giving a blank page?
how do i get 1) + B) and 2) + C) and 3) + C) to give custom without modifying web.xml? or do i need to modify web.xml on those?
my custom error page is set to /error/404.html and i have /error/404.html in ROOT.war -
3. Re: configuring custom error pages across all vhosts
brettcave Jan 28, 2009 4:56 AM (in response to brettcave)its not vhost specific, it seems to be context specific.
Is there a way to set error-page location to a different context / absolute url?
e.g. i want to deploy my error pages to context-root of /error
and then in /myapp/ specify that error-page location is /error/error.jsp
but using /error/error.jsp loads /myapp/error/error.jsp, rather than the absolute path.