Attached is a patch that seems to solve the problem. Please check it before
commiting - its not very elegant, but does the trick. 

On 15 Jul 2001 16:15:52 -0000, [EMAIL PROTECTED] wrote:
--
> http://nagoya.apache.org/bugzilla/show_bug.cgi?id=2631
> 
> *** shadow/2631       Sun Jul 15 09:15:52 2001
> --- shadow/2631.tmp.24988     Sun Jul 15 09:15:52 2001
> ***************
> *** 0 ****
> --- 1,28 ----
> + +============================================================================+
> + | JspGenerator doesn't allow relative src                                    |
> + +----------------------------------------------------------------------------+
> + |        Bug #: 2631                        Product: Cocoon 2                |
> + |       Status: NEW                         Version: 2.0alpha CVS            |
> + |   Resolution:                            Platform: Other                   |
> + |     Severity: Normal                   OS/Version: Other                   |
> + |     Priority: Other                     Component: core                    |
> + +----------------------------------------------------------------------------+
> + |  Assigned To: [EMAIL PROTECTED]                                    |
> + |  Reported By: [EMAIL PROTECTED]                                      |
> + |      CC list: Cc:                                                          |
> + +----------------------------------------------------------------------------+
> + |          URL:                                                              |
> + +============================================================================+
> + |                              DESCRIPTION                                   |
> + When the JspGenerator src parameter is a path relative to the current sitemap
> + context, the generator will fail, producing a 
> +  org.apache.jasper.JasperException: Unable to compile class for JSP
> + 
> + To reproduce:
> +  * Remove the leading slash from the JSP sample pipeline src parameter. It
> + becomes:    
> +    <map:match pattern="jsp/*">
> +     <map:generate type="jsp" src="docs/samples/jsp/{1}.jsp"/>
> +     <map:transform src="stylesheets/page/simple-page2html.xsl"/>
> +     <map:serialize type="html"/>
> +    </map:match>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]
> 



--
Sergio Carvalho
---------------
[EMAIL PROTECTED]

If at first you don't succeed, skydiving is not for you
? deploy.sh
? bug2631.patch
? src/org/apache/cocoon/acting/PassParameterAction.java
Index: src/org/apache/cocoon/generation/JspGenerator.java
===================================================================
RCS file: 
/home/cvspublic/xml-cocoon2/src/org/apache/cocoon/generation/JspGenerator.java,v
retrieving revision 1.10
diff -u -u -r1.10 JspGenerator.java
--- src/org/apache/cocoon/generation/JspGenerator.java  2001/07/11 19:20:12     1.10
+++ src/org/apache/cocoon/generation/JspGenerator.java  2001/07/15 17:43:19
@@ -89,7 +89,12 @@
 
         Parser parser = null;
         try {
-            MyServletRequest request = new MyServletRequest(httpRequest, this.source);
+            String resolvedSource = this.resolver.resolve(this.source).getSystemId();
+            // Guarantee src parameter is a file
+            if (!resolvedSource.startsWith("file:/"))
+               throw new IOException("Protocol not supported: " + resolvedSource);
+
+            MyServletRequest request = new MyServletRequest(httpRequest, 
+resolvedSource.substring(5));
             MyServletResponse response = new MyServletResponse(httpResponse);
 
             // start JSPServlet.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to