Exception handling in JSP
Tutorials Shared by the Internet Community
|Top Tutorials||New Tutorials||Submit||Login||Register|
Total Hits: 19758
Total Votes: 164 votes
Category: JAVA/JAVA Misc
Submitted on: 2013-12-23 08:31:03
Submitted By: Chaitanya
Description:Exception is nothing but a condition which can cause an abnormal termination of a program flow. Most of the times an exception occurs due to wrong data entered by user. In this tutorial we will see how to handle exceptions in Java Server Pages(JSP). There are two ways to handle exceptions in JSP.
1) Using try-catch block in scriptlet: It is similar to the exception handling in java. Since scriptlet in JSP allows us to use java code in JSP pages, we are free to handle exceptions using try catch blocks in scriptlet.
2) Using exception implicit object: Using scriptlet in JSP is disregarded a long time back so its better to handle exception in this way. We can handle any execption in JSP using exception implicit object. More detail...