Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

No blank screen

 
John Pugh
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic