aspose file tools
The moose likes JSP and the fly likes Error Page problem? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » JSP
Reply Bookmark "Error Page problem?" Watch "Error Page problem?" New topic
Author

Error Page problem?

Weston Kornfeld
Greenhorn

Joined: Mar 01, 2005
Posts: 28
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
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56153
    
  13

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.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Weston Kornfeld
Greenhorn

Joined: Mar 01, 2005
Posts: 28
Yes, it is within the .jsp.

Also, I am using struts but I wound't think that should make any difference.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56153
    
  13

Hmmm, and genericError.jsp is declared as an error page?
Weston Kornfeld
Greenhorn

Joined: Mar 01, 2005
Posts: 28
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" %>
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

<%@ page isErrorPage="true"%>


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Weston Kornfeld
Greenhorn

Joined: Mar 01, 2005
Posts: 28
Yes, I have that in the actual error page itself.
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1506
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..."


Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Error Page problem?
 
Similar Threads
JSP throwing exception problem
error page for runtime exceptions
HELP! Exception Processing ErrorPage
web.xml error-page throws exception on s:text
jsp:include error handling