Hi,
We are having the Similar system, That is when ever the User gets an error
in processing. We are displaying the Different Error messages depending on
teh Error type.
<!-- Copyright (c) 2000 by Scient. All Rights Reserved.-->
<%@ page language="java" import="java.util.*, java.math.*,
com.rocket.util.*, com.rocket.agent.hotel.*,
com.rocket.agent.plane.FlightResponse,
com.rocket.jsphelper.booking.ItemUserPlaneHelper,com.rocket.customer.myrocke
t.PlaneItemWrapper, com.rocket.entitybean.order.PlaneItemSegment" %>
<%@ include file="/include/globalHeader.jsp" %>
<jsp:useBean id="rocketError" scope="session"
class="com.rocket.util.RocketError"/>
<% String pageTitle="SB Exception Page"; %>
<%@ include file="/include/body.jsp" %>
<%@ include file="/include/header.jsp" %>
<table width="574" cellspacing="0" cellpadding="0" border="0">
<tr>
<td width="18" rowspan="99"><img src="/assets/global/spacer.gif"
width="18" height="1" border="0" /></td>
<td width="31" rowspan="99" bgcolor="#FFFFFF"><img
src="/assets/global/spacer_ffffff.gif" width="31" height="1" border="0"
/></td>
<td width="10" bgcolor="#FFFFFF"><img
src="/assets/global/spacer_ffffff.gif" width="10" height="25" border="0"
/></td>
<td width="445" bgcolor="#FFFFFF"><img
src="/assets/global/spacer_ffffff.gif" width="445" height="10" border="0"
/><br /><font face="Verdana,Arial,Helvetica" size="+3" color="#333333"
class="T1">Error!</font><br /></td>
<td width="10" bgcolor="#FFFFFF"><img
src="/assets/global/spacer_ffffff.gif" width="10" height="1" border="0"
/></td>
<td width="46" rowspan="99" bgcolor="#FFFFFF"><img
src="/assets/global/spacer_ffffff.gif" width="46" height="1" border="0"
/></td>
<td width="14" rowspan="99" bgcolor="#CC0000"><img
src="/assets/global/spacer_cc0000.gif" width="14" height="1" border="0"
/></td>
</tr>
<tr>
<td colspan="3" width="465" bgcolor="#FFCC66"><img
src="/assets/global/spacer.gif" width="1" height="20" border="0" /></td>
</tr>
<tr>
<td width="10" bgcolor="#FFFFFF"><img
src="/assets/global/spacer_ffffff.gif" width="1" height="100" border="0"
/></td>
<td width="445" bgcolor="#FFFFFF"><font face="Verdana,Arial,Helvetica"
color="#000000" size="-1"
class="T19"><%=rocketError.getUserMessage()%></font><br /><br /></td>
<td width="10" bgcolor="#FFFFFF"><spacer type="block" width="1"
height="1" /></td>
</tr>
</table>
<table width="574" cellspacing="0" cellpadding="0" border="0">
<tr>
<td rowspan="99" width="18"><img src="/assets/global/spacer.gif"
width="18" height="1" border="0" /></td>
<td rowspan="99" width="31" bgcolor="#FFFFFF"><img
src="/assets/global/spacer_ffffff.gif" width="31" height="1" border="0"
/></td>
<td width="344" bgcolor="#FFFFFF"><img
src="/assets/global/spacer_ffffff.gif" width="223" height="7" border="0"
/></td>
<td rowspan="3" width="121" bgcolor="#FFFFFF"><a href=<%
rocket.encode(response, rocketError.getUrl()) %>><img
src="/assets/global/buttons/bu_next_orange.gif" width="121" height="42"
border="0" alt="next" /></a></td>
<td rowspan="99" width="46" bgcolor="#FFFFFF"><img
src="/assets/global/spacer_ffffff.gif" width="46" height="1" border="0"
/></td>
<td rowspan="99" width="14" bgcolor="#CC0000"><img
src="/assets/global/spacer_cc0000.gif" width="14" height="1" border="0"
/></td>
</tr>
<tr>
<td width="223" bgcolor="#FFCC66" valign="top"><img
src="/assets/global/spacer.gif" width="223" height="20" border="0" /></td>
</tr>
<tr>
<td width="223" bgcolor="#FFFFFF" valign="top"><img
src="/assets/global/spacer_ffffff.gif" width="223" height="15" border="0"
/></td>
</tr>
<tr>
<td colspan="2" bgcolor="#FFFFFF" valign="top"> </td>
</tr>
</table>
<%@ include file="/include/footer.jsp" %>
</body>
</html>
And there is a java code which gets the error message from the
errormessages.txt file. This is a simple java program.
Please look in to the JSP and under stand.
Thanks
Nag
-----Original Message-----
From: Arunanshu_Gupta@n...
[mailto:Arunanshu_Gupta@n...]
Sent: Wednesday, May 30, 2001 9:50 AM
To: Professional Java
Subject: [pro_java] How to give the link to previous page on
errorpage.jsp
Hi,
1. I have made an error page (error.jsp) that needs to be called from any
JSP
(in my application) where an exception is encountered. I want to give the
link
to the previous correctly displayable page from error.jsp using "Back...."
button. Kindly tell me the way to do it. I would greatly appreciate if you
can
tell me the exact code to be written.
2. On every JSP, I have declared this page as error page by stating
errorPage="error.jsp". Now I want whenever an exception occurs, a message to
be
passed to this error.jsp which will tell the user what to do to avoid the
exception. Is there a way to do it? If yes, how?
Thanks
Arunanshu
Tata Consultancy Services
www.tcs.com