bloritsch    01/03/09 07:29:56

  Modified:    src/org/apache/cocoon/reading Tag: xml-cocoon2
                        DatabaseReader.java
  Log:
  Fixed DatabaseReader so that it can use the proper outputstream.
  It WORKS!!!!!
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.3   +4 -5      
xml-cocoon/src/org/apache/cocoon/reading/Attic/DatabaseReader.java
  
  Index: DatabaseReader.java
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon/src/org/apache/cocoon/reading/Attic/DatabaseReader.java,v
  retrieving revision 1.1.2.2
  retrieving revision 1.1.2.3
  diff -u -r1.1.2.2 -r1.1.2.3
  --- DatabaseReader.java       2001/03/09 15:07:29     1.1.2.2
  +++ DatabaseReader.java       2001/03/09 15:29:55     1.1.2.3
  @@ -33,6 +33,8 @@
   import java.io.IOException;
   import java.util.Date;
   
  +import org.xml.sax.SAXException;
  +
   import javax.servlet.http.HttpServletResponse;
   import javax.servlet.http.HttpServletRequest;
   
  @@ -89,7 +91,7 @@
        * Lastly, the <code>key</code> value is derived from the value of
        * the <code>source</code> string.
        */
  -    public void generate() throws org.apache.cocoon.ProcessingException, 
org.xml.sax.SAXException, java.io.IOException {
  +    public void generate() throws ProcessingException, SAXException, 
IOException {
           DataSourceComponent datasource = null;
           Connection con = null;
   
  @@ -208,7 +210,6 @@
           }
   
           InputStream is = object.getBinaryStream();
  -        OutputStream os = response.getOutputStream();
   
           byte[] bytes = new byte[(int) object.length()];
           is.read(bytes);
  @@ -222,8 +223,6 @@
           }
   
           response.setHeader("Accept-Ranges", "bytes");
  -        os.write(bytes);
  -        os.flush();
  -        os.close();
  +        out.write(bytes);
       }
   }
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     [EMAIL PROTECTED]
To unsubscribe, e-mail:          [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to