wood burning stoves*
The moose likes Struts and the fly likes Opening a new browser window in Action 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 » Frameworks » Struts
Bookmark "Opening a new browser window in Action" Watch "Opening a new browser window in Action" New topic
Author

Opening a new browser window in Action

Mike London
Ranch Hand

Joined: Jul 12, 2002
Posts: 1043
I see this question posted around, but never found an answer.

I wrote some JavaScript that opens a new browser window. Works fine. In that browser window, I display a PDF.

The question I keep getting is why didn't I use some "struts" mechanism to open a new browser window. My thinking is that Struts is limited to the HTTP protocol and thus can't do what Javascript can do on the client side (like open a new window...).

Is this correct or is there a way to open a completely new browser window on the client from, say, an Action method in Struts?

Thanks in advance.

Mike
Vj Borkar
Greenhorn

Joined: Jan 10, 2007
Posts: 7
Javascript is a client side scripting, where as Struts Action and/or Servlets/JSP is at server side.
So obviously, there is no way one can control browsing window from the code that would run purely at the Server in this case Struts. Some fragement should run at client side to make this happen.


Regards,
VJ
SCJP 1.4, SCJP 6.0, SCWCD 1.4
 
jQuery in Action, 2nd edition
 
subject: Opening a new browser window in Action
 
Similar Threads
popup in struts or any other way to notify?
How to catch browser minimized event
New browser window in struts?!
catching page change or browser close
pass a parameter from a struts ActionForm to a javascript fn