Solved

What is the scope of <%@ page errorPage="" %>? Does it get passed to jsp:forwarded pages? Does it get passed to jsp:included pages?

Posted on 2004-08-14
4
256 Views
Last Modified: 2010-04-01
thanks
sudha
0
Comment
Question by:sudhaker
  • 3
4 Comments
 
LVL 14

Accepted Solution

by:
sudhakar_koundinya earned 125 total points
ID: 11801840
The errorPage="SomePage" attribute can be present in either the JSP that includes or forwards to another JSP OR in the included or forwarded JSP OR in both the parent/calling JSP and the JSPs included/forwarded. In all these cases the attribute will work .  The control will 'not be' redirected to the errorPage specified from these JSP pages, in case the exception is explicitly caught in them. To redirect the control to the errorPage either do not catch an exception in the JSP page OR throw an exception explicitly. I did some experimentation and found out that errorPage is passed on to forwarded and included pages. The forwaded or included page can always override the errorPage with own <%@ page errorPage="errorPage.jsp" %> directive.

And also note that This is not equivalent to try{} catch(Exception ex) {Response.sendRedirect("error.jsp"); } as response.sendRedirect("error.jsp") will redirect the response to other page - is like forward. While <%@ page errorPage = .... is like include.
0
 

Author Comment

by:sudhaker
ID: 11801841
Hmmm
0
 

Author Comment

by:sudhaker
ID: 11801847
ok i understand that
0
 

Author Comment

by:sudhaker
ID: 11801848
just got a silly doubt
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
JSP Popup page 2 153
Set up Wildfly 10 8 443
console vs log file 16 83
Using Tomcat as raspberry pi java app server 13 226
Arrow Electronics was searching for a KVM  (Keyboard/Video/Mouse) switch that could display on one single monitor the current status of all units being tested on the rack.
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

713 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question