Hi Daniel,

have you try to set the following header:

      response.setHeader("Content-disposition", "attachment;
filename=\"myFile.pdf\"");

HTH
Robert

> -----Ursprüngliche Nachricht-----
> Von: Daniel Jaffa [mailto:[EMAIL PROTECTED]]
> Gesendet: Montag, 18. November 2002 22:43
> An: Struts Users Mailing List
> Betreff: Problem with forward
> 
> 
> Ok, i have an action that creates a pdf.  The action then 
> forwards it self
> to a Servlet that should display the just generatered PDF.
> 
> When i call the servlet directly it works fine
> http://10.132.240.33:82/domesticviolence/GenPDF/
> 
> but when my Action forwards to the servlet nothing happens
> <forward name="dataLoaded" path="/GenPDF/" redirect="true"/>
> 
> I get no error messages, or any HTML error page.
> 
> I know that ie has a problem with the length of the response 
> object but i am
> handling that correctly.
> 
> Any idea on how to fix the problem.
> 
> Daniel Jaffa
> 
> 
> public class Transform
> {
> 
>  public void Transform() {}
>  private static Logger logger = Logger.getLogger(Transform.class);
>  public static void action (HttpServletRequest request, 
> HttpServletResponse
> response)
>  {
>    javax.servlet.ServletOutputStream ostream;
>    FileInputStream fis;
>    byte[] theByte;
> 
>  try {
>   String orderNumber = (String) request.getAttribute("orderNumber");
>   String formApprovedID = (String) 
> request.getAttribute("formApprovedID");
>   RegistryBean myForm = (RegistryBean) request.getAttribute("myForm");
>   theByte = FileByte.convertFileToByte("/pdf/myfile.pdf");
>   ostream = response.getOutputStream();
>   response.setContentType("application/pdf");
>   ostream = response.getOutputStream();
>   ByteArrayOutputStream baos = new ByteArrayOutputStream();
> 
>   FileInputStream from = new FileInputStream("/pdf/myfile.pdf");
> 
>   byte[] buffer = new byte[4096];
>   int bytes_read;
>   while((bytes_read = from.read(buffer)) != -1)
>   {
>    baos.write(buffer, 0, bytes_read);
>   }
>   response.setContentLength( baos.size());
>   baos.writeTo(ostream);
>   ostream.flush();
>   ostream.close();
>   response.flushBuffer();
>   logger.debug("Buffer Size" + response.getBufferSize());
>   logger.debug("isCommitted()" + response.isCommitted());
>   } catch( Exception e) {System.err.println(e);}
> 
> 
> 
> 
> 
>   }
>   }
> 
> 
> 
> --
> To unsubscribe, e-mail:   
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: 
> <mailto:[EMAIL PROTECTED]>
> 

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

Reply via email to