Lesson - 17 : JSP - JSP Exception handling

Lesson - 17 : JSP - JSP Exception handling

Sada Learning Hub

7 лет назад

459 Просмотров

An exception is an event, which occurs during the execution of a program, that disrupts the normal flow of the program's instructions.

Exception
When an error occurs within a method, the method creates an object and hands it off to the runtime system. The object, called an exception object, contains information about the error, including its type and the state of the program when the error occurred. Creating an exception object and handing it to the runtime system is called throwing an exception.

errorPage:
This attribute is used to inform the container to jump the control to another JSP page if an exception is occur in the current JSP page.
The another JSP page is going to handle the exception occurred in the current page.
For example: <%@page errorPage="b.jsp"%>

isErrorPage :
This attribute is used to inform the container that make a JSP as an errorPage or not.
The default value of this attribute is false. It means a JSP page is not acting an errorPage by default.
To make a JSP page as an errorPage then we should write isErrorPage="true".
In JSP isErrorPage attribute and an implicit object calle exception are inter related.
If isErrorPage="true" then only exception object is allowed into a JSP page.
For example:<%@page isERRORPage="true" %>


Sample Projects : https://github.com/SadaLearningHub1/JSP-Projects

Тэги:

#Introduction_to_JSP #JSP_Translation_At_Server #Life_cycle_of_JSP #JSP_scripting_elements #JSP_Directive_element #JSP_implicit_object #JSP_Standard_Action_element #Custom_tags_and_Creating_custion_tags #body_tag_support_class #JSP_Exception_handling #Attributes_in_JSP #EL_in_JSP #JSTL_Tags_in_JSP #Web_Security_-_Basic_and_form_and_client_certificate_authentication #jsp_interview_questions #jsp_by_durgasoft #jsp_by_naveen #jsp_by_navin_reddy #jsp_by_ratan
Ссылки и html тэги не поддерживаются


Комментарии: