Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Send response to a Frame or Parent of a Frame

 
Bruce Jin
Ranch Hand
Posts: 672
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64629
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Philip Shanks
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Bruce Jin
Ranch Hand
Posts: 672
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic