Tutorials Shared by the Internet Community
|Top Tutorials||New Tutorials||Submit||Login||Register|
Tutorial Basic Detail
Total Hits: 18267
Total Votes: 159 votes
Average Rating: 2.91 out of 5
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.