Solved

Redirecting a page..

Posted on 2001-09-18
6
765 Views
Last Modified: 2007-12-19
Hi everybody, I am using framesets which has got a TOP Frame and Bottom Frame. I have <form> in the bottom form. After submitting the Form, I am redirecting to a HTML page which I want to open in a main window (Parent / no framesets) and not in the bottom window and also not in a new page. How to proceed on with JSP. SUggestions or Piece of code is always welcome.
0
Comment
Question by:epdass
[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
  • 3
  • 2
6 Comments
 
LVL 5

Accepted Solution

by:
aryumin earned 25 total points
ID: 6490339
1. <form .... target="_top">

2. For Netscape browsers only:
response.addHeader("Window-target", "_top");

3. Use a client-side Javascript instead of redirect:
out.println("<script language=\"javascript\">");
out.println("top.location.href = \"page.htm\";");
out.println("</script>");
0
 
LVL 1

Expert Comment

by:praburamalingam
ID: 6492426
1.Assume this to be your bottom frame.
2.Add this script
     <script language="JavaScript">
       function calme()
       {
     window.open("http://www.prabooo.com","_parent");
       }
     </script>
3.From the submit button call the script
  <form>
  <input type="button" onClick="calme()">
  </form>
4.this redirects to the url and opens in the whole window.
Hope this would hlp u.

0
 
LVL 5

Expert Comment

by:aryumin
ID: 6492575
2praburamalingam: Is the piece of Javascript code better than <form ... target="_top">? :o)

PS. "Often, an Expert posts the solution to your problem as a comment because it is early in the collaboration process and other issues may be involved. In addition, it is common etiquette in some topics areas to always post comments and not answers."
(c) http://www.experts-exchange.com/jsp/cmtyQuestAnswer.jsp#7
0
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 

Author Comment

by:epdass
ID: 6492838
I like to accept the comment by aryumin
0
 

Author Comment

by:epdass
ID: 6492845
Hi

I find "<form target=_top>" itself enough for my work.

But I don't understand ur js

"-------------
2For Netscape browsers only:
response.addHeader("Window-target", "_top");

3. Use a client-side Javascript instead of redirect:
out.println("<script language=\"javascript\">");
out.println("top.location.href = \"page.htm\";");
out.println("</script>");
 "------------
Can I know the use of this code?

cheers
epdass
0
 
LVL 5

Expert Comment

by:aryumin
ID: 6493071
The solution (2) will work with Netscape browsers only. You should send the additional HTTP header before redirect (in JSP, assume response is a com.caucho.server.http.Response, for example):
<%
response.addHeader("Window-target", "_top");
response.sendRedirect("http://www.server.com/some_page.jsp");
%>

The solution (3) is a _client-side_ javascript. Simply replace the
<%
response.sendRedirect("http://www.server.com/some_page.jsp");
%>
line with
<%
out.println("<script language=\"javascript\">");
out.println("top.location.href = \"http://www.server.com/some_page.jsp\";");
out.println("</script>");
%>
in your JSP page.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

705 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