struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aladin Alaily" <str...@aladin.ca>
Subject Re: Opening a NEW browser for a 2nd content type from an action
Date Thu, 12 May 2005 15:08:09 GMT
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
> ChaChaNY@Gmail.com
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message