aspose file tools*
The moose likes Servlets and the fly likes Send response to a Frame or Parent of a Frame Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Send response to a Frame or Parent of a Frame" Watch "Send response to a Frame or Parent of a Frame" New topic
Author

Send response to a Frame or Parent of a Frame

Bruce Jin
Ranch Hand

Joined: Sep 20, 2001
Posts: 666
Based on the result of some business logic, my servlet needs to decide (on the fly) to send the response back to either the frame or to the parent of the frame.
Is this possible?
Thanks!


BJ - SCJP and SCWCD
We love Java programming. It is contagious, very cool, and lot of fun. - Peter Coad, Java Design

Crazy Bikes created by m-Power
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61218
    
  66

It is not. The response will be sent back to the window or frame that originated the request. You need to decide which frame will get the request prior to submission.
bear


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Philip Shanks
Ranch Hand

Joined: Oct 15, 2002
Posts: 189
Originally posted by Bear Bibeault:
It is not. The response will be sent back to the window or frame that originated the request. You need to decide which frame will get the request prior to submission.

To expand a bit on Bear's reply,
The response will be sent back to the originating window or frame, unless the target attribute is set to point to a different window or frame, but as Bear says, this does need to be known at request time.
If the logic that determines the target is based on request paramters, you can set the target via client side Javascript. If this needs to be determined on the server side, then you're out of luck.


Philip Shanks, SCJP - Castro Valley, CA
My boss never outsources or has lay-offs, and He's always hiring. I work for Jesus! Prepare your resume!
Bruce Jin
Ranch Hand

Joined: Sep 20, 2001
Posts: 666
Thanks for the responses.
I do need to determine where the page should go at server side. How about this plan:
Assume my servlet is originated from frame1. If I want the page go back to frame1 I send this page back:

If I want the page go back to the parent of frame1 I send this back:
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Send response to a Frame or Parent of a Frame