Ashok
Ashok

Reputation: 337

how to use error page in jsp with source code

in jsp page is "a.jsp",if i use <%@ page errorpage="b.jsp" %> directive in "a.jsp",My Question is how to use errorpage in jsp?what are the source code to keep in "b.jsp",Please explain in detail

Upvotes: 1

Views: 846

Answers (1)

Ramesh PVK
Ramesh PVK

Reputation: 15446

Your b.jsp which is error page should look like this:

<%@ page isErrorPage="true" import="java.io.*"%>

............
............
<!--Write your custom error message>
............
<!--Print your exception if required>
<%exception.printStackTrace(new java.io.PrintWriter(out));%>

References

Upvotes: 2

Related Questions