File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Opening a new browser window in Action" Watch "Opening a new browser window in Action" New topic

Opening a new browser window in Action

Mike London
Ranch Hand

Joined: Jul 12, 2002
Posts: 1130
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.

Vj Borkar

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.

SCJP 1.4, SCJP 6.0, SCWCD 1.4
I agree. Here's the link:
subject: Opening a new browser window in Action
It's not a secret anymore!