Link to home
Start Free TrialLog in
Avatar of uri22
uri22

asked on

jsp - error page

Im trying to use Errorpage.
In the main page I wrote:
<%@ page errorPage="Error.jsp"%>
In the Error.jsp I wrote:
<%@ page isErrorPage="true"%>

I tried to use the Exception object, for example:
<%=exception.toString()%>
But I couldnt.
What else should I add to get the exception object in Error.jsp?
(The browser gets to the right page "Error.jsp" does all the other things in the page except getting the Exception object).
Avatar of paragm
paragm

HI,

 You need to throw the exception initializing it with some value.
Avatar of uri22

ASKER

I forgot to write this in the original question,
I wrote:
<% if(x==null){
       throw new Exception("x=null);
} %>

It didnt work, how do I supose to throw this exception?
ASKER CERTIFIED SOLUTION
Avatar of rajendra_rathod
rajendra_rathod

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Please accept a comment or a proposed answer to this question- if not, please comment as to why not or delete it.

Thanks
Klaetu, EE Community Moderator
There has been no activity in this question in quite some time, and it looks like it has been abandoned. As part of our ongoing mission to clean up the topic areas, a Moderator will finalize this question within the next seven (7) days. At that time, either I or one of the other Moderators will force/accept the comment of rajendra_rathod.

DO NOT ACCEPT THIS COMMENT AS AN ANSWER. If you have further comments on this question or the recommendation, please leave them here.

Thanks,

Netminder
Community Support Moderator
Experts Exchange
Force/accepted by

Netminder
Community Support Moderator
Experts Exchange