Meaningless Drivel is fun!*
The moose likes Servlets and the fly likes Child Window 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 "Child Window" Watch "Child Window" New topic
Author

Child Window

Prabhu Chandrasekaran
Ranch Hand

Joined: Oct 14, 2000
Posts: 36
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

Joined: Oct 18, 2000
Posts: 33
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).]
 
wood burning stoves
 
subject: Child Window
 
Similar Threads
to disable browser's max & min buttons
WA #1.....word association
how do close mozilla window?
how many remaining?
alert window minimize?