• Post Reply Bookmark Topic Watch Topic
  • New Topic

Exception handling  RSS feed

 
Peter Kleczka
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please help me understand ... this article http://www.stardeveloper.com/articles/display.html?article=2001072401&page=1 says I can indicate a jsp to display upon exception, but there is also a setting in web.xml which (supposedly) lets you declare a page to go to whenever a particualr type of exception happens. Now my preference would be to throw my own custom exception objects in jsps and let the declaration in the web.xml handle it. But I guess I don't understand if that is "another" method from the one mentioned in the article above. And further, the web.xml thing doesn't seem to work in Webshpere v6 or Tomcat 5.

I'm grateful for explain or suggestions on your favorite way to handle jsp exceptions.

Thanks,
Peter
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just reading the first few lines of that article tells me that either the article or the author is very out of date.

Handling exceptions via deployment descriptor (web.xml) declarations is the way to go.

I can't speak for Websphere (in which very little appears to work correctly) but it works mighty fine in Tomcat.
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did someone say WebSphere?

The exception mapping in WebSphere works according to the spec, from my experience. IBM's Rational Application Developer has a special tab in the web.xml editor that helps you configure these settings.

So, with WebSphere, you can map exceptions to certain JSP pages. You can also map certain error codes, such as 404 or 500 errors, to certain pages as well. I'm not sure if that's part of the spec, or one of those fabulous IBM extensions, but both work pretty good.

-Cameron McKenzie
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!