• Post Reply Bookmark Topic Watch Topic
  • New Topic

redirect in target = parent

 
michael yue
Ranch Hand
Posts: 204
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have servlet that redirect user to a page with frames. How can I redirect to the page by putting its target="parent" to avoid the situation of frame within a frame.
Now i redirect as below:

res.sendRedirect("/scrmypm/thepage.jsp");

if not is there any other way?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can't. Once a request has been submitted to a particular window/frame there is no way to cause its response to be delivered to another.

You either need to submit the original request to the desired frame, or use some Javascript magic on the client side to control loading into frame (in other words, your response can write Javascript to the client that can cause the desired frame behavior).
 
michael yue
Ranch Hand
Posts: 204
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you show me how to write those javascript from the servlet part to make it display in target=_parent. Thanks
 
rajeev tiwari
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Rollin,
While sending the request from browser, set the target to parent (either for form or for link).
- Rajeev
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!