dims        01/07/16 07:28:06

  Modified:    src/org/apache/cocoon/generation Tag: cocoon_20_branch
                        JspGenerator.java
  Log:
  - Fix for Bug 2631 from Sergio Carvalho <[EMAIL PROTECTED]>
  - Release engine once we are done.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.6.2.7   +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.6.2.6
  retrieving revision 1.6.2.7
  diff -u -r1.6.2.6 -r1.6.2.7
  --- JspGenerator.java 2001/07/16 13:23:35     1.6.2.6
  +++ JspGenerator.java 2001/07/16 14:28:05     1.6.2.7
  @@ -36,7 +36,7 @@
    * results into SAX events.
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Davanum Srinivas</a>
  - * @version CVS $Revision: 1.6.2.6 $ $Date: 2001/07/16 13:23:35 $
  + * @version CVS $Revision: 1.6.2.7 $ $Date: 2001/07/16 14:28:05 $
    */
   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:     [EMAIL PROTECTED]
To unsubscribe, e-mail:          [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to