users@glassfish.java.net

Re: Path to custom default error page resources

From: <forums_at_java.net>
Date: Fri, 17 Feb 2012 02:48:06 -0600 (CST)

After some experimentation, I have come to the conclusion that it IS possible
- but not trivial - to implement user-defined error pages with images in
Glassfish. It is clear that ${com.sun.aas.instanceRoot} is NOT working when
used in the property 'send-error_1'. Here is a configuration that works:

  * Put the files in <domain>/docroot (your own index.html, your own 404.html,
    my-picture.jpg, etc)
  * Define send-error_1 to code=404 path=../docroot/404.html
  * In your own error pages, you can include the images with <img
    src="../docroot/my-picture.jpg" ...>

HOWEVER!

If you configure your Glassfish to sit behind Apache (with mod_jk), then any
invalid url (e.g. example.com/wrong) will result in *Apache's* 'Not found'
page.

And now the REALLY BAD news:

If your webapp is not working (e.g. example.com/my-webapp) then the browser
will receive your nice 404.html as 'text/plain', and show ITS SOURCE CODE
instead of a nice web page.

Something's badly wrong. I smell a bug. What could it be?

 


--
[Message sent by forum member 'tmpsa']
View Post: http://forums.java.net/node/882803