Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
    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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

servlet not forwarding exception to the error-page defined in web.xml

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hi,
I am trying to get my servlet's exception forwarded to error page defined in the web.xml.
In web.xml I have,
<error-page>
<exception-type>javax.servlet.ServletException</exception-type>
<location>/errorPage1.jsp</location>
</error-page>
And in my servlet, I am throwing ServletException.
As per the Servlet 2.3 specs, the exception should be forwarded to the error page.
The errorPage1.jsp has the following directive -
<%@ page language="java" isErrorPage="true" %>
But, when my servlet throws error, I just see a "Page Not Found" on my browser.
In the tomcat cache, I see the erroPage1.jsp converted into a servlet and compiled. This means that it is being requested, but the browser, instead of showing the contents of the errorPage1.jsp, just shows "Page Not Found"
Is there something I missed ?
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please don't post the same question in multiple forums. It creates duplicate conversations and wastes the time of the people trying to help you.
Anyone who wants to help should see this thread.
Dave
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic