aspose file tools
The moose likes JSP and the fly likes isErrorPage = Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » JSP
Reply Bookmark "isErrorPage = "true" has not function" Watch "isErrorPage = "true" has not function" New topic
Author

isErrorPage = "true" has not function

peter tong
Ranch Hand

Joined: Mar 15, 2008
Posts: 234
I have just two jsp, one is index.jsp, and has set
<%@ page errorPage="/ShowError.jsp" %>
then in the body, I create an exception as follow
<% double a1 = Double.parseDouble("abc") ; %>

then in ShowError.jsp, I write
<%@ page isErrorPage="true" %>
then in body, I write
<%= exception.toString() %>

but the result is
HTTP 500 - Internal server error

what is the problem?
the index.jsp and ShowError.jsp is placed in the same folder!!

I am using Netbean 5.5.1 and JBoss 4.2.2, I also try to use Tomcat 5.5.17 but the result is same!!
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56231
    
  13

Originally posted by peter tong:
the index.jsp and ShowError.jsp is placed in the same folder
That is not important. According to:the JSP ShowError.jsp should be in the root of the context.
[ June 26, 2008: Message edited by: Bear Bibeault ]

[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

HTTP 500 - Internal server error means nothing more than "There was a problem on the server".
Look in the tomcat/logs directory for log files with the real cause of the problem.

It could also be that you have MSIE configured to show "Friendly Error Pages". If so, everything on the JSP end could be fine.
Try disabling them.
Tools -> Options -> Advanced (tab) -> scroll down to "Show Friendly Error Messages" and uncheck that item.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
peter tong
Ranch Hand

Joined: Mar 15, 2008
Posts: 234
Try disabling them.
Tools -> Options -> Advanced (tab) -> scroll down to "Show Friendly Error Messages" and uncheck that item.

Great!!
This can solve the problem!! now my error page can be shown!!
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56231
    
  13

Of course, remember that this only fixes it in your browser. Visitors who are using IE will still see the "helpful" "friendly" message.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Originally posted by Bear Bibeault:
Of course, remember that this only fixes it in your browser. Visitors who are using IE will still see the "helpful" "friendly" message.


See this thread for a workaround:
http://www.coderanch.com/t/365499/Servlets/java/web-xml-error-page-not
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: isErrorPage = "true" has not function
 
Similar Threads
problem with errorPage and isErrorPage="true"
problem while declaring error page
Error Page problem?
Customised Error Page Not shown
Custom Error Page