Loading ...
Sorry, an error occurred while loading the content.

WebSphere running FOP

Expand Messages
  • Alexander.gabler@bmi.gv.at
    Well... I have following Problem: I run the following Code with Visual Age 3.5.2, it delivered the right PDF-Document... but then i deployed to WebSphere and
    Message 1 of 9 , Aug 30, 2001
    • 0 Attachment
      Well...
      I have following Problem:

      I run the following Code with Visual Age 3.5.2, it delivered the right
      PDF-Document...
      but then i deployed to WebSphere and the only thing i got was ...
      %PDF-1.3
      %

      The ByteArray had the full length of 10 instead of 1290 ...


      String fo = "<?xml version=\"1.0\" encoding=\"utf-8\"?><fo:root
      xmlns:fo=\"http://www.w3.org/1999/XSL/Format\"> ... </fo:root>";
      java.io.ByteArrayOutputStream out_stream = new
      java.io.ByteArrayOutputStream();
      org.apache.fop.apps.Driver driver = new org.apache.fop.apps.Driver(new
      org.xml.sax.InputSource(new java.io.StringReader(fo)), out_stream);
      driver.run();
      System.out.print(new String(out_stream.toByteArray()));


      Does anybody knows about problems running FOP with WebSphere having this
      effect...

      Xerces and Xalan works fine...

      tnx...
      Alexander

      System Config:
      OS: AIX 4.3.3.7
      WebSphere: 3.5.3 (think its JDK 1.1.8)
      FOP: 0.20.1
      Xalan: 1.2.2
      Xerces: 1.2.3
    • p6mip262@yahoo.fr
      I had similar problems 1. Use response.getOutputStream() instead of response.getWriter() 2. type : response.setContentType( application/pdf ) in your servlet
      Message 2 of 9 , Nov 20, 2001
      • 0 Attachment
        I had similar problems
        1. Use response.getOutputStream() instead of response.getWriter()
        2. type : response.setContentType("application/pdf") in your servlet


        --- In XSL-FO@y..., Alexander.gabler@b... wrote:
        >
        > Well...
        > I have following Problem:
        >
        > I run the following Code with Visual Age 3.5.2, it delivered the
        right
        > PDF-Document...
        > but then i deployed to WebSphere and the only thing i got was ...
        > %PDF-1.3
        > %
        >
        > The ByteArray had the full length of 10 instead of 1290 ...
        >
        >
        > String fo = "<?xml version=\"1.0\" encoding=\"utf-8\"?><fo:root
        > xmlns:fo=\"http://www.w3.org/1999/XSL/Format\"> ... </fo:root>";
        > java.io.ByteArrayOutputStream out_stream = new
        > java.io.ByteArrayOutputStream();
        > org.apache.fop.apps.Driver driver = new org.apache.fop.apps.Driver
        (new
        > org.xml.sax.InputSource(new java.io.StringReader(fo)), out_stream);
        > driver.run();
        > System.out.print(new String(out_stream.toByteArray()));
        >
        >
        > Does anybody knows about problems running FOP with WebSphere having
        this
        > effect...
        >
        > Xerces and Xalan works fine...
        >
        > tnx...
        > Alexander
        >
        > System Config:
        > OS: AIX 4.3.3.7
        > WebSphere: 3.5.3 (think its JDK 1.1.8)
        > FOP: 0.20.1
        > Xalan: 1.2.2
        > Xerces: 1.2.3
      • pascal_munerot
        Hi, I am having the very same problem on WebSphere at the moment. I am using both getOutputStream() and setContentType ( application/pdf ). Somehow, I managed
        Message 3 of 9 , Jun 6, 2002
        • 0 Attachment
          Hi, I am having the very same problem on WebSphere at the moment. I
          am using both getOutputStream() and setContentType
          ("application/pdf").

          Somehow, I managed to get it to work by appending a dummy parameter
          at the end of the URL that ends with .PDF (eg &servlet.pdf).

          But I still have not been able to do better. If you have any luck,
          let me know.

          I am using WSAD 4.03 (Test environment)


          Pascal

          --- In XSL-FO@y..., p6mip262@y... wrote:
          > I had similar problems
          > 1. Use response.getOutputStream() instead of response.getWriter()
          > 2. type : response.setContentType("application/pdf") in your servlet
          >
          >
          > --- In XSL-FO@y..., Alexander.gabler@b... wrote:
          > >
          > > Well...
          > > I have following Problem:
          > >
          > > I run the following Code with Visual Age 3.5.2, it delivered the
          > right
          > > PDF-Document...
          > > but then i deployed to WebSphere and the only thing i got was ...
          > > %PDF-1.3
          > > %
          > >
          > > The ByteArray had the full length of 10 instead of 1290 ...
          > >
          > >
          > > String fo = "<?xml version=\"1.0\" encoding=\"utf-8\"?><fo:root
          > > xmlns:fo=\"http://www.w3.org/1999/XSL/Format\"> ...
          </fo:root>";
          > > java.io.ByteArrayOutputStream out_stream = new
          > > java.io.ByteArrayOutputStream();
          > > org.apache.fop.apps.Driver driver = new org.apache.fop.apps.Driver
          > (new
          > > org.xml.sax.InputSource(new java.io.StringReader(fo)),
          out_stream);
          > > driver.run();
          > > System.out.print(new String(out_stream.toByteArray()));
          > >
          > >
          > > Does anybody knows about problems running FOP with WebSphere
          having
          > this
          > > effect...
          > >
          > > Xerces and Xalan works fine...
          > >
          > > tnx...
          > > Alexander
          > >
          > > System Config:
          > > OS: AIX 4.3.3.7
          > > WebSphere: 3.5.3 (think its JDK 1.1.8)
          > > FOP: 0.20.1
          > > Xalan: 1.2.2
          > > Xerces: 1.2.3
        • pascal_munerot
          ... I ... parameter ... exactly is ... Well basically, when I invoke the URL in order to produce the PDF output, both IE 5 and Websphere integrated web browser
          Message 4 of 9 , Jun 6, 2002
          • 0 Attachment
            --- In XSL-FO@y..., Oleg Tkachenko <olegt@m...> wrote:
            > pascal_munerot wrote:
            > > Hi, I am having the very same problem on WebSphere at the moment.
            I
            > > am using both getOutputStream() and setContentType
            > > ("application/pdf").
            > >
            > > Somehow, I managed to get it to work by appending a dummy
            parameter
            > > at the end of the URL that ends with .PDF (eg &servlet.pdf).
            > >
            > > But I still have not been able to do better. If you have any luck,
            > > let me know.
            > >
            > > I am using WSAD 4.03 (Test environment)
            >
            > I have no problems running fop on websphere3.5 at the moment, what
            exactly is
            > your problem?
            >
            > --
            > Oleg Tkachenko
            > Multiconn International, Israel


            Well basically, when I invoke the URL in order to produce the PDF
            output, both IE 5 and Websphere integrated web browser display a
            blank page.

            I used a tool called tcptunnel from soap in order to trace the
            request and response. The PDF stream is generated and seems okay. So
            i believe this has to do with the mime type somehow. And again, if I
            append an extra parameter to the URL (ending in .pdf), then it works
            fine. Weird !

            I have double-checked the fact that I assign the mime-type
            (setContentType) and length(SetContentLength) after I get an output
            stream (by using getOutputStream).


            Pascal
          • Oleg Tkachenko
            ... I have no problems running fop on websphere3.5 at the moment, what exactly is your problem? -- Oleg Tkachenko Multiconn International, Israel
            Message 5 of 9 , Jun 6, 2002
            • 0 Attachment
              pascal_munerot wrote:
              > Hi, I am having the very same problem on WebSphere at the moment. I
              > am using both getOutputStream() and setContentType
              > ("application/pdf").
              >
              > Somehow, I managed to get it to work by appending a dummy parameter
              > at the end of the URL that ends with .PDF (eg &servlet.pdf).
              >
              > But I still have not been able to do better. If you have any luck,
              > let me know.
              >
              > I am using WSAD 4.03 (Test environment)

              I have no problems running fop on websphere3.5 at the moment, what exactly is
              your problem?

              --
              Oleg Tkachenko
              Multiconn International, Israel
            • pascal_munerot
              ... moment. ... luck, ... what ... So ... I ... works ... I had forgotten to mention the following fact: When i go into Acrobat preferences and i uncheck
              Message 6 of 9 , Jun 6, 2002
              • 0 Attachment
                --- In XSL-FO@y..., "pascal_munerot" <pascal.munerot@m...> wrote:
                > --- In XSL-FO@y..., Oleg Tkachenko <olegt@m...> wrote:
                > > pascal_munerot wrote:
                > > > Hi, I am having the very same problem on WebSphere at the
                moment.
                > I
                > > > am using both getOutputStream() and setContentType
                > > > ("application/pdf").
                > > >
                > > > Somehow, I managed to get it to work by appending a dummy
                > parameter
                > > > at the end of the URL that ends with .PDF (eg &servlet.pdf).
                > > >
                > > > But I still have not been able to do better. If you have any
                luck,
                > > > let me know.
                > > >
                > > > I am using WSAD 4.03 (Test environment)
                > >
                > > I have no problems running fop on websphere3.5 at the moment,
                what
                > exactly is
                > > your problem?
                > >
                > > --
                > > Oleg Tkachenko
                > > Multiconn International, Israel
                >
                >
                > Well basically, when I invoke the URL in order to produce the PDF
                > output, both IE 5 and Websphere integrated web browser display a
                > blank page.
                >
                > I used a tool called tcptunnel from soap in order to trace the
                > request and response. The PDF stream is generated and seems okay.
                So
                > i believe this has to do with the mime type somehow. And again, if
                I
                > append an extra parameter to the URL (ending in .pdf), then it
                works
                > fine. Weird !
                >
                > I have double-checked the fact that I assign the mime-type
                > (setContentType) and length(SetContentLength) after I get an output
                > stream (by using getOutputStream).
                >
                >
                > Pascal


                I had forgotten to mention the following fact:

                When i go into Acrobat preferences and i uncheck 'Display PDF in
                browser', quit Acrobat, and IE, and then restart IE and invoke the
                URL, then acrobat pops up and displays the PDF output just fine.

                Pascal
              • Alex Bischoff
                ... IE has the erroneous habit of assuming MIME types based on file extensions. For instance, even if you serve an .html as text/plain (such as if you
                Message 7 of 9 , Jun 6, 2002
                • 0 Attachment
                  pascal_munerot wrote:
                  > i believe this has to do with the mime type somehow. And again, if I
                  > append an extra parameter to the URL (ending in .pdf), then it works
                  > fine. Weird !

                  IE has the erroneous habit of assuming MIME types based on file extensions.
                  For instance, even if you serve an ".html" as "text/plain" (such as if you
                  wanted to display a page's source code as part of an HTML tutorial), the file
                  will still be rendered in IE.

                  So, when you add the ".pdf" extension, IE may be invoking that behavior. When
                  you add the ".pdf" extension, how does Mozilla render the file?

                  --
                  Alex Bischoff 3812078 on ICQ
                  -------------------------------------------------------------------------
                  export-a-crypto-system-sig RSA-2-lines-PERL
                  print pack"C*",split/\D+/,`echo "16iII*o\U@{$/=$z;[(pop,pop,unpack"H*",<>
                  )]}\EsMsKsN0[lN*1lK[d2%Sa2/d0<X+d*lMLa^*lN%0]dsXx++lMlN/dsM0<J]dsJxp"|dc`
                  -------------------------------------------------------------------------
                  Proof That There Is Strength in Numbers --> http://www.distributed.net
                • pascal_munerot
                  ... behavior. When ... Well, I have just tested that. Mozilla seems to work fine but on the other hand from what I have just seen, WebSphere s browser behavior
                  Message 8 of 9 , Jun 6, 2002
                  • 0 Attachment
                    >
                    > So, when you add the ".pdf" extension, IE may be invoking that
                    behavior. When
                    > you add the ".pdf" extension, how does Mozilla render the file?

                    Well, I have just tested that. Mozilla seems to work fine but on the
                    other hand from what I have just seen, WebSphere's browser behavior
                    is quite erratic. At the first invocation of the URL it displays the
                    PDF stream as text, I then add the extra parameter &servlet.pdf and
                    it gives me the correct page, and then when I try again, this time
                    removing the extra parameter, it works (on WebSphere browser).

                    My brain is getting confused.

                    I may have done something silly in the way I set the response back.

                    Thanks for your time anyway.

                    Pascal.
                  • Cerny Christian
                    Hi there ! Maybe one of the following lines may help you. // Set attachment for save-dialog, inline for in-browser-view if (saveFileDialog) {
                    Message 9 of 9 , Jun 7, 2002
                    • 0 Attachment
                      Hi there !

                      Maybe one of the following lines may help you.

                      // Set "attachment" for save-dialog, "inline" for in-browser-view

                      if (saveFileDialog)
                      {
                      res.addHeader("Content-Disposition", "attachment; filename=" +
                      documentFileName);
                      }
                      else
                      {
                      res.addHeader("Content-Disposition", "inline; filename=" +
                      documentFileName);
                      }

                      where "res" is an HttpServletResponse object and "documentFileName" the Name
                      of the PDF-Document as you guessed right.

                      It solved the described issues for us in IE.

                      have fun

                      ChrisC

                      -----Original Message-----
                      From: pascal_munerot [mailto:pascal.munerot@...]
                      Sent: Thursday, June 06, 2002 7:38 PM
                      To: XSL-FO@yahoogroups.com
                      Subject: [XSL-FO] Re: WebSphere running FOP


                      >
                      > So, when you add the ".pdf" extension, IE may be invoking that
                      behavior. When
                      > you add the ".pdf" extension, how does Mozilla render the file?

                      Well, I have just tested that. Mozilla seems to work fine but on the
                      other hand from what I have just seen, WebSphere's browser behavior
                      is quite erratic. At the first invocation of the URL it displays the
                      PDF stream as text, I then add the extra parameter &servlet.pdf and
                      it gives me the correct page, and then when I try again, this time
                      removing the extra parameter, it works (on WebSphere browser).

                      My brain is getting confused.

                      I may have done something silly in the way I set the response back.

                      Thanks for your time anyway.

                      Pascal.





                      To unsubscribe from this group, send an email to:
                      XSL-FO-unsubscribe@egroups.com



                      Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
                    Your message has been successfully submitted and would be delivered to recipients shortly.