1. What version of IE are you using, and is a Microsoft ISA server between you
and the J2EE server?
2. Instead of returning a PDF in one step, do it in two stages...never mind. I
was going to tell you what we've done, but that was to return TIFF to the
browser. PDF will always fire up the Acrobat Reader, you can't embed it in a
page. FWIW, what we do for TIFFs is to have the first request stage the file (a
call to Content Manager to locate and prepare it) and then forward to the JSP
that displays the TIFF by having an <IMG> tag's src point to another Action
which will stream the TIFF back (hopefully at this point Content Manager has
found and staged the file, so the second request will send back data without delay).
Rick DeBay
On Wed, 3 Mar 2004 20:43 , Vasudevrao Gupta <[EMAIL PROTECTED]> sent:
>
>I tried that..It does not give an error but when I close the browser window
>in which the .pdf is displayed, it gives a microsoft error and closes all
>other browsers
>
>
>
>
>-----Original Message-----
>From: [EMAIL PROTECTED]
>[EMAIL PROTECTED]','','','')">[EMAIL PROTECTED]
>Sent: Wednesday, March 03, 2004 8:23 PM
>To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
>Subject: RE: Viewing .pdf files usign struts frames work..
>
>
>return null from the action instead of returnign a forward.
>
>-----Original Message-----
>From: Vasudevrao Gupta
[EMAIL PROTECTED]','','','')">[EMAIL PROTECTED]
>Sent: Wednesday, March 03, 2004 3:58 PM
>To: 'Struts Users Mailing List'; 'Satya Narayan Dash'
>Subject: Viewing .pdf files usign struts frames work..
>
>
>
>Hi All,
>
>I am trying to view a pdf file using struts frame work..
>I am able to view the file ,but it throws an illegalStateException as struts
>forward the request after I send the output stream.
>
>Below is the action mapping:
>
> path="/viewScannedFile"
> scope="request"
>
>type="com.rwe.thameswater.els.enquiry.action.ViewScannedFileRefAction"input=
>"/screens/enquiry/jsp/ADS_ELS_CreateEnquiry.jsp"
>validate="true">
>
>
>
>
>below is the action class execute() method:
>try {
>
> MessageResources resource = this.getResources(request);
> String scannedFileFolder = (String)
>resource.getMessage(ELSEnquiryConstantsIF.SCANNED_FILE_LOCATN);
> System.out.println("scannedFileFolder>>"+scannedFileFolder);
> String scannedFileExtn = (String)
>resource.getMessage(ELSEnquiryConstantsIF.SCANNED_FILE_EXTN);
> System.out.println("scannedFileExtn>>"+scannedFileExtn);
> String scannedFileLocation = scannedFileFolder +
>request.getParameter("scannedFileReference") + scannedFileExtn;
>
> System.out.println("scannedFileLocation>>"+scannedFileLocation);
> String contentType = (String)
>resource.getMessage(ELSEnquiryConstantsIF.SCANNED_FILE_CONTENT);
> System.out.println("contentType>>"+contentType);
> response.setContentType(contentType);
> File pdfFile = new File(scannedFileLocation);
> response.setContentLength((int) pdfFile.length());
> FileInputStream in = new FileInputStream(pdfFile);
> request.setAttribute("FILE",in);
> OutputStream out = response.getOutputStream();
>
> byte[] buf = new byte[4096];
> int count = 0;
> while ((count = in.read(buf)) >= 0) {
> out.write(buf, 0, count);
> }
> out.flush();
> in.close();
> out.close();
> } catch (Exception e) {
>
> // Report the error using the appropriate name and ID.
> System.out.println("Exception found while viewing>>"+e);
> errors.add("name", new ActionError("id"));
>
> }
> return (mapping.findForward("SUCCESS"));
>}
>
>Please suggest me anyother alternative using the struts framework
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]