Hi,
Why "            // Guarantee src parameter is a file" ?
Why do you set the restriction jsp-url must start with 'file:'?
Why not allow jsp from war-files?
Why not using ServletContext.getResourceAsStream() ?

I don't know the Servlet-Spec 100% but WLS does not unzip the war 
file to a directory, at least in WLS6.0.
Thus if Cocoon2 is packaged as war file including jsps it does not
work, accessing the jsp (beside some other troubles)

bye

----- Originalnachricht -----
Von: Davanum Srinivas <[EMAIL PROTECTED]>
Datum: Montag, Juli 16, 2001 6:56 pm
Betreff: Re: [Bug 2631][patch] New:  - JspGenerator doesn't allow 
relative src

> Sergio,
> 
> Checked in your patch as well as componentized the JSP access into 
> a JSPEngine/JSPEngineImpl. Can
> you please check if this works for you.
> 
> Thanks,
> dims
> 
> --- Sergio Carvalho <[EMAIL PROTECTED]> wrote:
> > 
> > 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/or> Index: src/or> 
> ===================================================================> 
RCS file: /home/cvspublic/xml-cocoon2/src/or> retrieving revision 1.10
> > diff -u -u -r1.10 JspGenerator.java
> > --- src/or> +++ src/or> @@ -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]
> 
> 
> =====
> Davanum Srinivas, JNI-FAQ Manager
> http://www.jGuru.com/faq/JNI
> 
> __________________________________________________
> Do You Yahoo!?
> Get personalized email addresses from Yahoo! Mail
> http://personal.mail.yahoo.com/
> 
> -------------------------------------------------------------------
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]
> 
> 
begin:vcard
n:Huber;Bernhard
fn:Bernhard Huber
version:2.1
email;internet:[EMAIL PROTECTED]
end:vcard

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to