• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to get errors in jsp page

 
Ranch Hand
Posts: 378
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ???


Frank
[ April 17, 2007: Message edited by: Bear Bibeault ]
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Add the following in web.xml
<error-page>
<error-code>500</error-code>
<location>/ErrorDisplay.jsp</location>
</error-page>


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

Hope that works.
 
reply
    Bookmark Topic Watch Topic
  • New Topic