cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jo...@apache.org
Subject cvs commit: cocoon-2.1/src/blocks/jsp/java/org/apache/cocoon/components/jsp JSPEngineImpl.java
Date Thu, 29 Jan 2004 10:34:13 GMT
joerg       2004/01/29 02:34:13

  Modified:    src/blocks/jsp/java/org/apache/cocoon/components/jsp
                        JSPEngineImpl.java
  Log:
  clean up for the case of an exception (try + finally), thanks to Marco Rolappe (m_rolappe.at.web.de)
  
  Revision  Changes    Path
  1.10      +8 -7      cocoon-2.1/src/blocks/jsp/java/org/apache/cocoon/components/jsp/JSPEngineImpl.java
  
  Index: JSPEngineImpl.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/jsp/java/org/apache/cocoon/components/jsp/JSPEngineImpl.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- JSPEngineImpl.java	16 Jan 2004 13:49:32 -0000	1.9
  +++ JSPEngineImpl.java	29 Jan 2004 10:34:13 -0000	1.10
  @@ -104,14 +104,15 @@
           Class clazz = Thread.currentThread().getContextClassLoader().loadClass(this.jspServletClass);
           Servlet servlet = (Servlet) clazz.newInstance();
           servlet.init(new JSPEngineServletConfig(context,"JSPEngineImpl"));
  -        servlet.service(request, response);
           
  -        bytes = output.toByteArray();
  +        try {
  +            servlet.service(request, response);
  +            bytes = output.toByteArray();
  +        } finally {
  +            // clean up
  +            servlet.destroy();
  +        }
           
  -        // clean up
  -        servlet.destroy();
  -
           return bytes;
       }
  -
   }
  
  
  

Mime
View raw message