dims 01/07/16 07:27:43
Modified: src/org/apache/cocoon/generation JspGenerator.java
Log:
- Fix for Bug 2631 from Sergio Carvalho <[EMAIL PROTECTED]>
- 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:[EMAIL PROTECTED]">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: [EMAIL PROTECTED]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]