File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes open popup from servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "open popup from servlet" Watch "open popup from servlet" New topic
Author

open popup from servlet

Fernando Dominguez
Ranch Hand

Joined: Sep 01, 2006
Posts: 104

Is there any way to open a poppup from a servlet?

I don�t want to go to a jsp, and thrn open another window using javascript.

Any idea?

Thanks.
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Popups are browser behaviour. Servlets are server side behaviour, so it can't interact with the browser directly. You'll need to serve some JavaScript to do it.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Steven Harmision
Greenhorn

Joined: Dec 25, 2008
Posts: 1
Good post.Popups are browser behaviour. Servlets are server side behaviour, so it can't interact with the browser directly. You'll need to serve some JavaScript to do it.

Relationship
Relationships
Relationship Problems
Rene Larsen
Ranch Hand

Joined: Oct 12, 2001
Posts: 1179

You can add "target=_blank" to the link where the Servlet is called from.

e.g.


when the Servlet return to the client, then it will open in the new waiting window.

Otherwise you need to use some kind of javascript to configure a popup.


Regards, Rene Larsen
Dropbox Invite
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
Originally posted by Fernando Dominguez:
Is there any way to open a poppup from a servlet?
HTTP fortunately disallows PUSH. The whole web would have looked like very different.

Use target="_blank" in <a> or <form> element or use Javascript's window.open(). There are no more options.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: open popup from servlet