The html file is located under above the WEB-INF dir. I try this out by forcing a servlet that throws a MessagingException to rethrow an EmailException(derived from ServletException) but I get a 404 that says it can't locate the email_exception.html??? Something wrong with paths??? edited tags to show the XML [ July 19, 2002: Message edited by: Frank Carver ]
The location entry is relative to the application root. (e.g. http://www.myserver.net/myapp/email_exception.html ) and should be placed at the top of the web application, with your other html files. Is that where you have put it ? Have you checked the name of the file is exactly the same, including the case and the '_' ?
Yes, I've tried every possible location-value- removing "/", removing "http:/" etc. AND crosschecked spellings 100 times. I even tried this approach in web.xml:
...though, without "id=/myapp" but same errors! Anyway, I solved it with HttpServletResponse stream to hardcode some html in the catch-block. Poor solution? Maybe, but it works... please comment on this and thanks for your reply! /Steffe
sorry, here it is again without the code-tags: <web-app id='/foo'> <error-page exception-type='java.lang.NullPointerException'<br /> location='/nullpointer.jsp'/> </web-app>
The problem is that HTML markup is turned "on" for this forum, so the tags are swallowed by UBB (the bulletin board software). The trick is to place a space after each < character, so that UBB doesn't recognize them as markup. I'll edit your last one for you to show how.