wood burning stoves 2.0*
The moose likes Servlets and the fly likes Opening a window popup from within a Servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Opening a window popup from within a Servlet" Watch "Opening a window popup from within a Servlet" New topic
Author

Opening a window popup from within a Servlet

Ragav Baskaran
Ranch Hand

Joined: Nov 04, 2007
Posts: 36
Hello All,

I have a requirement to open a window popup and display an information pdf file in the popup. Before opening this popup a set of inputs will be collected in a form and the same will be validated in the servlet.

If the validation is through then it should open and display the information pdf file in the popup or else it will show a validation message in the custom built error component. I'm using the below code to create a popup from within a servet and "info.serv/InfoServ" will take care of writing the pdf contents to the servlet output stream.



This piece of code works fine, however my question here is, If this information popup is already opened and if i try to invoke the action again it is overwriting the content of existing popup instead of creating a new popup. My expectation here is that, It should open a new popup everytime a new action is fired.

Can one of you help me in explaining/overcoming this behavior ?

Thanks,
Ragavendran.
Ragav Baskaran
Ranch Hand

Joined: Nov 04, 2007
Posts: 36
I have resolved it myself. This was happening as the window name of the popup was hardcoded to "Information" and whenever the browser attempts to open the popup it is already finding a window named "Information" and thus it overwritting the same popup.


Thanks,
Ragavendran.
Sebastian Janisch
Ranch Hand

Joined: Feb 23, 2009
Posts: 1183
Please, check out the concept of JSPs. You'll love them :-)


JDBCSupport - An easy to use, light-weight JDBC framework -
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Opening a window popup from within a Servlet
 
Similar Threads
Javascript new window is not opening from a jsp page
To Invoke new HTML page containging an JApplet
window.open()?
Opening a child window
Windows XP Popup blocking