nbubna      2004/11/10 15:18:35

  Modified:    src/java/org/apache/velocity/tools/view ImportSupport.java
  Log:
  fix issue w/multiple calls to ImportResponseWrapper's getWriter() or 
getOutputStream()(bug #32146, patch by Shinobu Kawai)
  
  Revision  Changes    Path
  1.11      +9 -3      
jakarta-velocity-tools/src/java/org/apache/velocity/tools/view/ImportSupport.java
  
  Index: ImportSupport.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-velocity-tools/src/java/org/apache/velocity/tools/view/ImportSupport.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- ImportSupport.java        9 Sep 2004 19:37:26 -0000       1.10
  +++ ImportSupport.java        10 Nov 2004 23:18:35 -0000      1.11
  @@ -303,7 +303,10 @@
                                                   + "Target servlet called 
getWriter(), then getOutputStream()");
               }
               isWriterUsed = true;
  -            sw = new StringWriter();
  +            if (sw == null)
  +            {
  +                sw = new StringWriter();
  +            }
               return new PrintWriter(sw);
           }
   
  @@ -318,7 +321,10 @@
                                                   + "Target servlet called 
getOutputStream(), then getWriter()");
               }
               isStreamUsed = true;
  -            bos = new ByteArrayOutputStream();
  +            if (bos == null)
  +            {
  +                bos = new ByteArrayOutputStream();
  +            }
               ServletOutputStream sos = new ServletOutputStream()
                   {
                       public void write(int b) throws IOException
  
  
  

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

Reply via email to