Exception handling in JSP
Tutorials Shared by the Internet Community
Total Hits - 31368
Total Votes - 112 votes
Vote Up - 52 votes
Vote Down - 60 votes
Domain - beginnersbook.com
Category - JAVA/JAVA Misc
Submitted By - Chaitanya
Submitted on - 2013-12-23 08:31:03
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...