?
Solved

jsp error page

Posted on 2003-03-27
4
Medium Priority
?
229 Views
Last Modified: 2010-04-01
how can I direct an error frame to another frame?

i.e. <%@ page errorPage="error.jsp" ???target="main.jsp"??? %>

if my menu frame causes an error the error page will open up in the main frame

0
Comment
Question by:RapidDrinker
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 14

Accepted Solution

by:
kennethxu earned 150 total points
ID: 8222142
no, you cannot do this. http protocol is a request/respose mode. where to display the response is decided by brower before it send out the request.

but you can return the error page which contain javascript to auto submit itself to main fram. for example:

<form name="errorform" target="mainframe" method="post" action="displayerr.jsp">
<input type=hidden name="errormessage" value="<%=errormessage%>">
.....
</form>
<script>
errorform.submit();
</script>
0
 
LVL 9

Expert Comment

by:nimaig
ID: 8222861
What you can do is check if there is an error. If error has occured ... then open the error.jsp using javascript

<%if(errorHasOccured){%>
  <SCRIPT language="javascript">
  <!--
      top.<OTHER FRAME NAME>.location.href = "error.jsp";
  //-->
  </SCRIPT>
<%}%>

 
0
 
LVL 14

Expert Comment

by:kennethxu
ID: 8225431
>> top.<OTHER FRAME NAME>.location.href = "error.jsp";
this way, the error page cannot determine the exception and original error message.
0
 
LVL 35

Expert Comment

by:girionis
ID: 10060893
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

- Points to kennethxu

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

girionis
EE Cleanup Volunteer
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

New style of hardware planning for Microsoft Exchange server.
This month, Experts Exchange’s free Course of the Month is focused on CompTIA IT Fundamentals.
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question