Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Redirecting a page..

Posted on 2001-09-18
6
Medium Priority
?
769 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 75 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses

636 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