wood burning stoves 2.0*
The moose likes Servlets and the fly likes Opening in a new window Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Opening in a new window" Watch "Opening in a new window" New topic
Author

Opening in a new window

savitha rao
Greenhorn

Joined: Jun 05, 2001
Posts: 6
How do i redirect a servlet to jsp or a html opened in a new popup window?
Karthik Guru
Ranch Hand

Joined: Mar 06, 2001
Posts: 1209
Originally posted by savitha rao:
How do i redirect a servlet to jsp or a html opened in a new popup window?

hi,
I guess window.open("jspurl") w'd work.
Pls check out the javascript window.open() method i think u can also pass pop up window dimensions to the open() method.
karthik.
Rama Chennupati
Greenhorn

Joined: Jul 26, 2001
Posts: 1
Originally posted by savitha rao:
How do i redirect a servlet to jsp or a html opened in a new popup window?

I am trying to do the same thing.
Here is the solution.
<SCRIPT language=javascript>
function newWindow(form) {
myLeft = (screen.width-600)/2;
myTop = (screen.height-500)/2;
var newWin = window.open(form, 'form', 'toolbar=yes,scrollbars=yes,resizable=yes,width=640,height=500,top='+myTop
+',left='+myLeft);
newWin.focus();
}
</script>
<FORM>
<CENTER>
<INPUT TYPE=button VALUE="Submit" onClick="newWindow('http://localhost:7001/testServlet?Page=test');">
</CENTER>
</FORM>

Thanks,
Rama


[This message has been edited by Rama Chennupati (edited July 26, 2001).]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Opening in a new window
 
Similar Threads
Open pdf file
eclipse 2.0
For set focus on frame..
new page on submission
Client/browser