How do you restrict page errors display in the JSP page

Showing Answers 1 - 6 of 6 Answers

bhanu

  • Jun 4th, 2005
 

set isErrorPage=false

  Was this answer useful?  Yes

Srini

  • Jul 9th, 2005
 

oh ! this approach doesn't always works...

  Was this answer useful?  Yes

pradeep

  • Jul 26th, 2005
 

what is the exact answer 
restrict page errors display in the JSP page

  Was this answer useful?  Yes

PChal

  • Aug 11th, 2005
 

 
In the web.xml you define an error page that the errors must be directed to. If the directed page is a Jsp page then the isErrorPage will be set to " true " which means that the implicit exception object is available to that jsp page and it can be used to get the exception message 
 
 
 
java.lang.Exception 
 
/error.jsp 
 
 
 
error.jsp 
 
<%= exception.getMessage() %> NO SEMICOLON

  Was this answer useful?  Yes

Sumit Sengar

  • Aug 23rd, 2005
 

The intent of the question is what u can do to prevent errors getting displayed on the jsp when it has encountered any exception during execution. There are two ways to do this. 
1. Whtever errors will be displayed on the jsp on exception should be displayed in a seperate page rather than on the same page. Thjis is achieved by putting dis fragment of code in the jsp. 
<%@ page errorPage="/error.jsp"%> 
this will forward any type of exceptions to the seperate page error.jsp. 
In error.jsp define as <%@page iserrorPage="true"%> 
2. The other approach is u define specifix escptiosn at specific plasces. Like for all java type exceptions you define in web.xml just after tag as  
 
 
java.lang.NumberFormatException 
xxx.jsp 
 
whenever any NumberFormatException wil occur in the jsp then jsp container wil search for errorPage attribute of < @page > tag if none is specified then wil go to tag of web.xml and wil match the exception type with that n display the page specified in loaction. 

  Was this answer useful?  Yes

Nisar Khatib

  • Sep 14th, 2005
 

hi, We Can restrict page errors by using the two attributes of page directive i.e. error attribute set to true and then use the errorPage attributes that specifies the url of Error page.

Thanks

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions