Woh!  IE *does not* use the URL to determine content type.  It's
determined by the MIME type sent back with the response from the
server.

And, by default, the option to have IE save encrypted data to disk is
turned on, so there won't be an issue with PDFs and SSL unless
Micro$oft has changed this is XPSP2.  I'm running XPSP2 at home and
have no problem viewing PDFs over an encrypted connection.  Micro$oft
would be breaking a lot of clients if they chose to change that
setting.

Virtually,
Andre Van Klaveren, SCP


On Mon, 14 Mar 2005 13:43:51 -0700, Larry Meadors
<[EMAIL PROTECTED]> wrote:
> Why are you doing that in a jsp? You can do it in an action, but it
> will not work that well (but it will work better tahn in a jsp, i
> promise).
> 
> The other issue is that a URL ending in /foo.do?name=value will not be
> seen by IE as a pdf. You should probably use a servlet for this
> instead, then you can map the URL like the one above as this:
> /foo/name/value/file.pdf, that will trick the browser into thinking
> that it is just a static file.
> 
> Another problem you will have is that if you are using ssl, IE will
> not allow acrobat to read from the cache. Your users will have to hack
> the registry to make it work.
> 
> Larry
> 
> 
> On Mon, 14 Mar 2005 14:01:48 -0600, Brad Balmer <[EMAIL PROTECTED]> wrote:
> > I'm using Jasper to create PDF's through my Actions and cannot figure out a
> > good way to export the resulting byte[] to the user.
> >
> > Currently the tail end of my Action class looks like this:
> >
> > byte[] reportBytes = null;
> >
> > File jasperReport = new File(location);
> >
> > try {
> >
> > reportBytes = JasperRunManager.runReportToPdf(jasperReport.getPath(),
> > parameters, dataSource);
> >
> > log.info("Found : " + reportBytes.length);
> >
> > } catch (JRException e) {
> >
> > e.printStackTrace();
> >
> > }
> >
> > response.setContentType("application/pdf");
> >
> > response.setContentLength(reportBytes.length);
> >
> > ServletOutputStream ouputStream = response.getOutputStream();
> >
> > ouputStream.write(reportBytes, 0, reportBytes.length);
> >
> > ouputStream.flush();
> >
> > ouputStream.close();
> >
> > return(null);
> >
> > This will display the pdf, but the action class itself somehow get called a
> > second time as the above log statement is displayed twice.
> >
> > I also tried to set the byte[] on the request and forward onto another page
> > which does:
> >
> >       <%
> >
> >             byte[] reportBytes =
> > (byte[])request.getAttribute("REPORT_BYTES");
> >
> >           response.setContentType("application/pdf");
> >
> >       response.setContentLength(reportBytes.length);
> >
> >             ServletOutputStream ouputStream = response.getOutputStream();
> >
> >             ouputStream.write(reportBytes, 0, reportBytes.length);
> >
> >             ouputStream.flush();
> >
> >             ouputStream.close();
> >
> >       %>
> >
> > But this complains about: getOutputStream() has already been called for this
> > response
> >
> > Any ideas?
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


-- 
Virtually,
Andre Van Klaveren
SCP

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to