Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Catching HTTP Error Responses  RSS feed

 
Jenn Person
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I wasn't sure which forum this was best suited for, so my apologies if this is the wrong place. I'm trying to catch HTTP Error Responses like 404, 500, etc using the error-page element in my deployment descriptor.

For example I have this in my web.xml file:


When I enter in a url like http://localhost:8080/myapp/nonsense, where nonsense doesn't exist, I get my browser's or container's response depending on the error code instead the error.jsp page I've prepared.

How can I properly catch these?
[ June 05, 2007: Message edited by: Jenn Person ]
 
Chandra Bhatt
Ranch Hand
Posts: 1710
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Be sure that you have explicitly defined the page directive:
<%@ page isErrorPage ="true"%> in the error page.

Configuring an error page in the DD is not just enough.

Thanks,
[ June 05, 2007: Message edited by: Chandra Bhatt ]
 
Jenn Person
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Chandra,

I tried adding <%@ page isErrorPage="true" %> to my error page, but it still isn't working. Is there anything else I'm missing beside this code and what I've already placed in my DD?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66188
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you just trying this in IE? If so, see what happens in other browsers. IE is notorious for subtituting its own error pages for your own.
 
Jenn Person
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good point, I am actually! I'll try Firefox and see what I get. Thanks Bear.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!