File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Opening in a new window

 
savitha rao
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do i redirect a servlet to jsp or a html opened in a new popup window?
 
Karthik Guru
Ranch Hand
Posts: 1209
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic