cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Morrison, John" <John.Morri...@uk.experian.com>
Subject RE: [C2] Case insensitive java classes
Date Wed, 27 Jun 2001 09:03:47 GMT


> -----Original Message-----
> From: Carsten Ziegeler [mailto:cziegeler@sundn.de]
> Sent: Wednesday, 27 June 2001 10:01
> To: cocoon-dev@xml.apache.org
> Subject: AW: [C2] Case insensitive java classes
> 
> 
> > John Morrison wrote:
> >
> > > -----Original Message-----
> > > From: giacomo [mailto:giacomo@apache.org]
> > > Sent: Tuesday, 26 June 2001 19:25
> > > To: 'cocoon-dev@xml.apache.org'
> > > Subject: Re: [C2] Case insensitive java classes
> > >
> > >
> > > On Tue, 26 Jun 2001, Morrison, John wrote:
> > >
> > > > Hi All.
> > > >
> > > > I've a match along the lines of (with some validation 
> removed ;)...
> > > >
> > > > <map:match pattern="*/*.xml">
> > > >  <map:generate type="serverpages" src="docs/public/{3}.xml">
> > > >   <map:parameter name="param1" value="{1}"/>
> > > >  </map:generate>
> > > >  <map:serialize type="xml"/>
> > > > </map:match>
> > > >
> > > > Assume I have a file called docs/public/test.xml, which
> > > contains some xsp
> > > > code.  If I call this with the url
> > > http://xxx/context/john/test.xml I
> > > > (correctly) get the results.  If I (or, more likely
> > > somebody else) then call
> > > > http://xxx/context/john/Test.xml, I get errors...
> > >
> > > Where do you see ERRORs, you've posted only DEBUG messages.
> >
> > Ah, yes, good point.  Hang on...
> >
> > This line appears to be in error, Test should have a lower case 't'
> >
> > DEBUG   99355   [cocoon  ] (/context/john/Test.xml): Making URL from
> > file:/C:/Program Files/New Atlanta/ServletExec
> > ISAPI/webapps/default/context/docs/public/Test.xml
> >
> > I don't get any errors in the log but I do get this... in 
> the browser:
> >
> > Error. The server encountered an unexpected condition which 
> prevented it
> > from fulfilling the request.
> >
> > java.lang.NoClassDefFoundError:
> > org/apache/cocoon/www/docs/public_/Test_xml
> > (wrong name: org/apache/cocoon/www/docs/public_/test
> > 	at java.lang.ClassLoader.defineClass0(Native Method)
> > 	at java.lang.ClassLoader.defineClass(ClassLoader.java:486)
> >
> > > >
> > > > DEBUG   99355   [cocoon  ] (/context/john/Test.xml):
> > > UnnamedSelector:
> > > > ComponentSelector could not find the component for hint:
> > > > org\apache\cocoon\www\docs\public_\Test_xml
> > > > DEBUG   99355   [cocoon  ] (/context/john/Test.xml): Could
> > > not access
> > > > component for hint: org\apache\cocoon\www\docs\public_\Test_xml
> > > > java.lang.NullPointerException:
> > > > 	at
> > > >
> > > org.apache.cocoon.components.language.generator.GeneratorSelec
> > > tor.select(Gen
> > > > eratorSelector.java:82)
> > > > 	at
> > > >
> > > org.apache.cocoon.components.language.generator.ProgramGenerat
> > > orImpl.select(
> > > > ProgramGeneratorImpl.java:269)
> > > >
> > > > I think that the name for the java code should be taken
> > > from the file name
> > > > of the xml *not* the url name.  Where should I look for this?
> > >
> > > I don't get this. Aren't the path names of the java code 
> produces from
> > > the file names? I don't know your os platform but case is 
> significant
> > > for cocoon urls as it is for any *nix type os as well.
> >
> > OK, I can't find a RFC which says that the path/file part of a
> > url should be
> > case in-sensitive, I'm willing to patch C2 where it is 
> (under windoze)
> > matching a file it shouldn't.  Any clues as to where to look?  I
> > think that
> > it should (optionally?) fail when 'Making URL from file' 
> when the file
> > doesn't match the case entered.
> >
> As far as I remember, URLs are case-sensitive, e.g. the 
> apache web server
> implements them in this way (even under windows). So it makes 
> a difference
> if you request "test.xml" or "Test.xml". Those are different
> resources/pages.
> 
> One suggestion for such a solution would be an case 
> insensitive matcher
> which produces all matches e.g. in lower case, so your 
> example would read:

*Very* good idea - I'll look at that.

> <map:match pattern="*/*.xml" type="caseinsensitive">
>     <map:generate type="serverpages" src="docs/public/{2}.xml">
>        <map:parameter name="param1" value="{1}"/>
>     </map:generate>
>     <map:serialize type="xml"/>
> </map:match>
> 
> And then passing in Test.xml or test.xml would always produce 
> "test.xml" for
> {2}.
> 
> Please not that in your example at the top of this email you 
> use {3} in the
> src
> argument, but this must be {2}.

*GRIN* Ah, you caught me.  I admit - this is an edited version.  I'm not
'allowed' to release the proper url, but the process stands.

Thanks,

J.


=======================================================================
Information in this email and any attachments are confidential, and may
not be copied or used by anyone other than the addressee, nor disclosed
to any third party without our permission.  There is no intention to
create any legally binding contract or other commitment through the use
of this email.

Experian Limited (registration number 653331).  
Registered office: Talbot House, Talbot Street, Nottingham NG1 5HF

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message