cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject cvs commit: xml-cocoon2/src/org/apache/cocoon/generation JspGenerator.java
Date Mon, 16 Jul 2001 14:27:43 GMT
dims        01/07/16 07:27:43

  Modified:    src/org/apache/cocoon/generation JspGenerator.java
  Log:
  - Fix for Bug 2631 from Sergio Carvalho <sergio.carvalho@acm.org>
  - Release engine once we are done.
  
  Revision  Changes    Path
  1.13      +11 -2     xml-cocoon2/src/org/apache/cocoon/generation/JspGenerator.java
  
  Index: JspGenerator.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/generation/JspGenerator.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- JspGenerator.java	2001/07/16 13:35:13	1.12
  +++ JspGenerator.java	2001/07/16 14:27:42	1.13
  @@ -36,7 +36,7 @@
    * results into SAX events.
    *
    * @author <a href="mailto:dims@yahoo.com">Davanum Srinivas</a>
  - * @version CVS $Revision: 1.12 $ $Date: 2001/07/16 13:35:13 $
  + * @version CVS $Revision: 1.13 $ $Date: 2001/07/16 14:27:42 $
    */
   public class JspGenerator extends ServletGenerator implements Recyclable, Configurable
{
   
  @@ -64,8 +64,16 @@
           JSPEngine engine = null;
           Parser parser = null;
           try {
  +            String url = this.resolver.resolve(this.source).getSystemId();
  +            // Guarantee src parameter is a file
  +            if (!url.startsWith("file:/"))
  +                throw new IOException("Protocol not supported: " + url);
  +
  +            url = url.substring(5);
  +            getLogger().debug("JspGenerator executing JSP:" + url);
  +
               engine = (JSPEngine)this.manager.lookup(JSPEngine.ROLE);
  -            byte[] bytes = engine.executeJSP(this.source, httpRequest, httpResponse, httpContext);
  +            byte[] bytes = engine.executeJSP(url, httpRequest, httpResponse, httpContext);
               ByteArrayInputStream input = new ByteArrayInputStream(bytes);
   
               // pipe the results into the parser
  @@ -88,6 +96,7 @@
               throw new ProcessingException("Exception JspGenerator.generate()",e);
           } finally {
               if (parser != null) this.manager.release(parser);
  +            if (engine != null) this.manager.release(engine);
           }
       }
   }
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org


Mime
View raw message