This is a discussion on How does JSP handle run-time exceptions? within the Java Server Pages (JSP) forums, part of the Web Development category; .........................
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| You can use the errorPage attribute of the page directive to have uncaught run-time exceptions automatically forwarded to an error processing page. For example: <%@ page errorPage="error.jsp" %> redirects the browser to the JSP page error.jsp if an uncaught exception is encountered during request processing. Within error.jsp, if you indicate that it is an error-processing page, via the directive: <%@ page isErrorPage="true" %> the Throwable object describing the exception may be accessed within the error page via the exception implicit object. Note: You must always use a relative URL as the value for the errorPage attribute.
__________________ cheers Aman |
| |||
| Using errorPage attribute of page directive and also we need to specify isErrorPage=true if the current page is intended to URL redirecting of a JSP.
__________________ Krishnakumar.S Beware of Everything -that is un true; stick to the Truth shall succeed slowly but steadily |
| |||
| 1.Create a jsp page called error.jsp in your web root. 2.Add this command in your all JSP page. <%@ page isErrorPage="true" %> 3.Specify the error page path like <%@ page errorPage="error.jsp" %> Then, if your page encounter a runtime error you will be redirect to the error page. Just add content on error page depending the type of the error |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How can we Handle Exception in VB.Net? | anbuchezhians | VB.NET Programming | 2 | 09-10-2007 04:19 AM |
| Exceptions using recovery scenario manager | Shanthi | Testing Tools | 1 | 08-25-2007 01:36 AM |
| object exceptions | simplesabita | Testing Tools | 1 | 08-22-2007 02:48 AM |
| classes of exceptions may be thrown by a throw statement | anbuchezhians | Java Programming | 1 | 08-01-2007 10:58 PM |
| Diff between Transaction-time and Server response-time | vadivelanvaidyanathan | Software Testing | 0 | 03-21-2007 06:29 AM |