Hi, I am trying to forward page when an exception occured in current page. Now I am trying to handle the exception for duplicate entry in database . But it not forward to the error page. Here is page where i may get an duplicate entry exception:
and here is an error page:
It does not show me any exception. Ant suggestion? thanks in advance? Regards Harshal.
Hi seetharaman , Thanks for your suggestion. I was not added error.jsp into web.xml but now added it. But there is no change in OUTPUT. The jsp page direct to next page without showing error message OF ERROR PAGE.
I am using netbeans IDE. Thanks and reagards Harshal [ August 06, 2008: Message edited by: Harshal Gurav ]
Or, stop putting code that can cause exceptions in your JSP which should be for display.
Put the SQL in a Servlet (or better a data access object accessed in a Servlet). The Servlet checks for the SQL error and forwards to the proper page in normal conditions or the error page in exception conditions.
The error page is a complex work-around for applications that don't follow a good MVC architecture. If you move the control to a Servlet the problem disappears (as do many other related problems).
I'm a lumberjack and I'm okay, I sleep all night and work all day. Lumberjack ad: