my dog learned polymorphism*
The moose likes Struts and the fly likes Opening content in a new window. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Opening content in a new window." Watch "Opening content in a new window." New topic
Author

Opening content in a new window.

Karl Beowulph
Ranch Hand

Joined: May 31, 2004
Posts: 130
Howdy.

In my current project, I generate a pdf (using iText) within my Action class and display it to the user.

What do I have to change so that the pdf is opened in a new window instead of the current one that the user is viewing?

Can I send a command to the clients browser to open a new window first? If so, how would I specify to use the new window instead of the original?
Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4727

You can set the header's Content-disposition to attachment.

If you'd rather keep it inline, then you'll probably have to do something with target="_blank" and refresh the new page to hit the Action that generates the pdf and display it there.


A good workman is known by his tools.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Opening content in a new window.