Meaningless Drivel is fun!
The moose likes JSP and the fly likes How to get errors in jsp page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "How to get errors in jsp page" Watch "How to get errors in jsp page" New topic

How to get errors in jsp page

Frank Jacobsen
Ranch Hand

Joined: May 17, 2002
Posts: 358
when i get a http 500 error, i want to set something on the session, i dont want to have a errorpage, i want to catch the error in the jsp page is this possible i have tryed too put a try catch around the whole thing, but nothing happens, any ideas out there ???

[ April 17, 2007: Message edited by: Bear Bibeault ]
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

Try/catch blocks work in JSPs.
It's not really a best practice to put Javacode in to JSPs but that's another issue.

Post your code with the try/catch block that's not working.

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
vijay kokatnur

Joined: Apr 18, 2007
Posts: 1
Add the following in web.xml

You can continue with your session operations in errordisplay.jsp!!

Hope that works.
I agree. Here's the link:
subject: How to get errors in jsp page
It's not a secret anymore!