Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

isErrorPage problem

 
peter tong
Ranch Hand
Posts: 250
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
a strange problem about isErrorPage occur!!
in a.jsp, I set <%@ page errorPage="errorPage.jsp" %>
then I intentionally add <%= 1/0 %> in a.jsp
then in errorPage.jsp, I add <%@page isErrorPage="true"%>
then in the body part, I add <I><%= exception %></I>
but the result is "The page cannot be displayed!" (http500),
why?
I use JBoss 4.2.2 and netBean 5.5.1
in debug mode, I see it can go to the errorPage.jsp, and the exception is correct (something like "/ by zero"), but <%= exception> has error, the debugger said
>Encountered "<" at line 1, column 1.
Was expecting one of:
"++" ...
"--" ...
"+" ...
"-" ...
"~" ...
"!" ...
<INTEGER_LITERAL> ...
<FLOATING_POINT_LITERAL> ...
<CHARACTER_LITERAL> ...
<STRING_LITERAL> ...
"true" ...
"false" ...
"null" ...
"this" ...
<IDENTIFIER> ...
"super" ...
"(" ...
"new" ...
"void" ...
"boolean" ...
"char" ...
"byte" ...
"short" ...
"int" ...
"long" ...
"float" ...
"double" ...
<

what is the problem?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65535
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your problem is that the error page cannot be displayed. In the directive:your URL is incomplete. Use a valid context-relative URL.
 
peter tong
Ranch Hand
Posts: 250
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I cannot get your meaning. my errorPage.jsp is placed in the same folder as a.jsp, should I write <%@ page errorPage="./errorPage.jsp" %>?

also, in Netbean debug mode, I can jump to the errorPage.jsp, but in the statement <%= exception%>, error occur!!
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65535
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's not the way it works. You should specify the URL as context-relative value.
 
peter tong
Ranch Hand
Posts: 250
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is context-relative? <%@ page errorPage = "http://www.xxxxxx.com/...jsp" %> something like that?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65535
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Starting with /, where the / represents the root folder of the web application.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!