• 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

Error Page problem?

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am trying to use the jsp error page mechanism to better handle when exceptions are thrown.

I believe I have things set up correctly, but when an exception is thrown in my web app my error page does not show up -- just a printout of the actual exception(i.e. as if the error page was not set up at all).

My set up is:

I have an error page: genericError.jsp

I am referencing that is a .jsp that can throw an exception as
<%@ page errorPage="genericError.jsp"%>

genericError.jsp is in the same directory as the page that might throw an exception so I don't think I need to fully qualify it.

Any ideas what the problem is? I am running weblogic.

Many Thanks
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

so I don't think I need to fully qualify it.



You don't, but I always do anyways. This eliminates any unintended coupling between the pages based upon location.

but when an exception is thrown in my web app my error page does not show up



Anywhere in the web app? The on-page declaration will only affect exceptions thrown within the JSP in which the declaration is made.

If you want a more general mechanism (which I recommend), declare the error handling in the web.xml file.
 
Weston Kornfeld
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, it is within the .jsp.

Also, I am using struts but I wound't think that should make any difference.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hmmm, and genericError.jsp is declared as an error page?
 
Weston Kornfeld
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When you say:

genericError.jsp is declared as an error page?

What do you mean?

The only thing I am doing is specifying it in my .jsp at the top of the .jsp file that could throw an error i.e.:

<%@page errorPage="genericError.jsp" %>
 
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
<%@ page isErrorPage="true"%>
 
Weston Kornfeld
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, I have that in the actual error page itself.
 
Ranch Hand
Posts: 1514
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Not sure if this is related to your problem. But, some versions of IE display their own friendly error page by default. Somewhere in your internet options you need to uncheck that checkbox that says "display friendly error messages or so..."
 
reply
    Bookmark Topic Watch Topic
  • New Topic