Error Message on Redirect

Hi all,

I have configured an error page in web.xml when an error occurs -

e.g. the file size limit exceeded.

This is a plain html page as I have not found a way to use a jsp.

Is it possible to give a detail error message? I want an error

page similar to the ExceptionHandler page, but without stack

traces .. I want to access the source of the error and give the user

a hint.

Thanks for any help,

Heike

[463 byte] By [hfra] at [2007-11-26 9:05:04]
# 1

To use a jsp file as an error page, you can include the following directive in a jsp file:

<%@ page errorPage="MyErrorPage.jsp" %>

Whenever an exception occurs in the jsp file, the control will then be transferred to MyErrorPage.jsp.

MyErrorPage.jsp should have the following directive at the top:

<%@ page isErrorPage="true" %>

If a jsp's iserrorpage is true, then it gets access to an implicit variable called 'exception'. You can therefore do something like the following in MyErrorPage.jsp:

<%= exception.toString() %>

KarthikR at 2007-7-6 23:16:33 > top of Java-index,Development Tools,Java Tools...