File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Changing the Target of a submitted form Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Changing the Target of a submitted form" Watch "Changing the Target of a submitted form" New topic

Changing the Target of a submitted form

Ram Thirumangalam

Joined: Aug 28, 2003
Posts: 20
I have a scenario as follows.
My webpage has 2 frames and I am submitting a form in the first frame (which has the target as the second frame) to a servlet and currently the response is writtten to the second frame. I have a new requirement now. Upon submitting the form, I have to interface with another app and based on the response I have to do either one of this:
Case A: Write the results to the second frame
Case B: Pop-up a new window providing the user with some options and requesting him to select one and then submit the form in it to write the results in the second frame.

The first Case is simple and is existing currently.

If the response from the other app is the second case, then Can I change the target of the servelet dynamically to write to a new window instead of the second frame?
How do I do this?
Any suggestions would be greatly appreciated.

Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63862

You can't. Once a request is sent to a specific target, there's no way to change which target the response will appear within. You will either need to use Javascript within that response to trigger further activity, or rework your requirements.
[ July 23, 2004: Message edited by: Bear Bibeault ]

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: Changing the Target of a submitted form
It's not a secret anymore!