File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes No blank screen Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "No blank screen" Watch "No blank screen" New topic
Author

No blank screen

John Pugh
Greenhorn

Joined: Aug 14, 2003
Posts: 2
Hi all,
Hope you can help me,
I'm using a jsp page to display a shopping list of sorts and each item has a checkbox next to it, to indicate whether or not it is selected, I want to be able to submit this page to a servlet to get the forms values, at the same time as this I want to open a new window to display another page which will need the current session as it needs to be submitted itself to another servlet and then it will be closed by the user.
I have attempted to do this by writing out javascript to the first window that is submitted, this opens the second window, but makes the first one blank which I don't want to happen as when the user shuts the second page they will have nothing to prompt them, so I tried to forward on a page to the first window in the servlet but this prevented javascript from opening the second window.
Does anyone know how to open a new window after a form has been submitted and still be able to put a new page in the original window ?
Sorry about the essay and thanks in advance,
John
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

you said:
want to be able to submit this page to a servlet to get the forms values, at the same time as this I want to open a new window to display another page

I think it depends on what you mean by 'at the same time'. Is after form processing good enough?

If so, one possible way is to have the 1st page submit to your servlet. The output of the servlet (the response of submitting that form) would have some javascript for the onLoad method of the page its producing.

So when the response page appears from the form submission, your second window could pop open.

That's one option.
 
Don't get me started about those stupid light bulbs.
 
subject: No blank screen