• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 232
  • Last Modified:

jsp error page

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
RapidDrinker
Asked:
RapidDrinker
  • 2
1 Solution
 
kennethxuCommented:
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
 
nimaigCommented:
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
 
kennethxuCommented:
>> top.<OTHER FRAME NAME>.location.href = "error.jsp";
this way, the error page cannot determine the exception and original error message.
0
 
girionisCommented:
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now