David, Aladin has a more straight forward approach. If you can know ahead of time when you need to open a new window, take his approach; if you have no prior knowledge, you'll need to send back JavaScript to open a new window. Either way should fit the bill.
Thanks, Paul -----Original Message----- From: David Johnson [mailto:[EMAIL PROTECTED] Sent: Thursday, May 12, 2005 11:17 AM To: Aladin Alaily; Struts Users Mailing List Subject: Re: Opening a NEW browser for a 2nd content type from an action whoa that's simple. I'm trying that first!!!! Thanks One things though, I'll have to set the "target" conditionally, only when the user clicks "PDF" or "EXCEL" since I dont **always** want it opening a new window... function setTarget(target) { document.forms[0].target=target; } On 5/12/05, Aladin Alaily <[EMAIL PROTECTED]> wrote: > > Hi Dave, > > This is pretty straightforward. In browser "a", you have a button that > says: > > "Export to PDF" > > The code would look like this: > > <html:form action="/exportToPdf.do" target="_NEW"> > <submit name="export" value="Export to PDF"> > </html> > > When the user clicks on the button, the action "exportToPdf.do" opens an > ServletOutputStream and writes whatever you want. The headers are also > set to the content-type you want and the format you want (inline or > attachment). > > Aladin > > > > Hey all > > > > is it possible to forme my struts app to open up a second browser window > > for > > the purpose of streaming a different content type (like a pdf file) into > > it > > while maintaining the page in the original browser? > > > > Essentially, I have a nicely rendered HTML report in browser "a" and > when > > the user clicks "export to PDF" or "export to excel" I want a NEW > browser > > to > > pop up into which I will send the response with the headerType set to > the > > appropriate type. > > > > the generation of the XL and PDF is handled for me, but the app flow is > > where Im foggy. > > > > anyone done this? > > > > -- > > -Dave > > [EMAIL PROTECTED] > > > > -- -Dave [EMAIL PROTECTED] ------------------------------------------------------------------------------ Notice: This e-mail message, together with any attachments, contains information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), and/or its affiliates (which may be known outside the United States as Merck Frosst, Merck Sharp & Dohme or MSD and in Japan, as Banyu) that may be confidential, proprietary copyrighted and/or legally privileged. It is intended solely for the use of the individual or entity named on this message. If you are not the intended recipient, and have received this message in error, please notify us immediately by reply e-mail and then delete it from your system. ------------------------------------------------------------------------------ --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]