Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Child Window

 
Prabhu Chandrasekaran
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Friends,
Just like in JavaScript, can we open a servlet in a new window using java. If so, how? A piece of code can be very useful if possible.
Advance Thanks ....

------------------
 
Rob Whelan
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure if you understand that servlets are entirely server-side software... basically, as far as a browser is concerned, a URL that accesses a servlet is the same as any other URL.
If you want to open the returned HTML from a servlet in a new window, use JavaScript, or just the "target" parameter in your anchor or form tag:
<A href="/servlet/MyServlet" target="_blank">open servlet page</A>
- or -
<FORM action="/servlet/MyServlet" method="POST" TARGET="_blank"> form contents... </FORM>
If you're displaying the page from an applet, just use the standard Applet call showDocument( URL, "_blank" ) to do that. If you need to POST data to that servlet and display the result to a new window... Well, I've done it, but you need to use Netscape's LiveConnect (yes, IE supports it) to communicate with JavaScript.
[This message has been edited by Rob Whelan (edited October 20, 2000).]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic