agarlita,dan wrote:

I have some questions about error customisation.
I want to change the look of 500 Error. (that is
org.apache.jasper.JasperException)
so, I want to redirect all strings to the new page.

so, for example the 404 error is simple becouse we know that is "Page Not
Found"
but, the 500 Error can report errors like "According to the TLD or the tag
file, attribute operation is mandatory for tag sql"
how can I send that string (exception string) in the new page?

First, create custom error page, then mention it in web.xml like this:


<error-page>
 <error-code>500</error-code>
 <location>/error.jsp</location><!-- Your page name -->
</error-page>

(Look at web-app_2_3.dtd to see where you must put it -- the order of XML tags is important).
That page should declare itself as error page (<%@ page ... isErrorPage="true" ... %>). When a 500 error occurs, container will invoke this page, setting "exception" scripting variable (JSP 2.0 section 1.4.3) or "javax.servlet.jsp.jspException" request attribute (JSP 1.2 section 2.4.2) to the appropriate Throwable object.
To get your exception string, try Throwable.getMessage() .



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to