cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rob Norman <...@harveyroad.org>
Subject Re: PropertiesFileModule
Date Wed, 28 Sep 2005 10:36:40 GMT
Thanks for the quick response.  I tried using 
"context:/config.properties" in cocoon.xconf and that works for loading 
the file directly from WEB-INF.

However, cocoon:/ doesn't work.  I have a matcher in my sitemap that 
matches on config.properties (I can load it from the browser using the 
appropriate URL ok) but it doesn't want to work in the xconf.  I'm 
gussing this is because the sitemap isn't properly loaded when cocoon 
reaches that part in it's initialisation.  The problem is that I need to 
change config files depending on what host the user is loading the page 
from so I need to use the matcher.

Cheers,
    Rob.

> Hi,
>
> cocoon:/ represents the url part that matches your sitemap. cocoon:// 
> represents the root url for cocoon. note that when using cocoon: you 
> need to have a match pattern that catches you request. In your case, 
> you need a match for "config.properties".
>
> Alternatively, you could use context:/ (or was it context://?) which 
> refers to the webapp _directory_ of cocoon.
>
> Refrain from using file: protocol when accessing files from within the 
> webapp or web-inf. When you deploy the web application as a war and it 
> is _not_ extracted but read directly by the application server, this 
> results in file not found errors... :-P
>
> HTH,
> Geert
>
> Rob Norman wrote:
>
>> Hi,
>>
>> I'm having problems with the PropertiesFileModule in Cocoon 2.1.7 
>> under Tomcat 5.0.  I'm trying to load a simple properties file from a 
>> cocoon matcher (the URI in the cocoon.xconf is 
>> cocoon:/config.properties) I figured that since it uses a 
>> SourceResolver and the examples use resource:/, it should work.  
>> However, it keeps saying "Cannot load properties file".
>>
>> I then changed it to not have the cocoon:/ on the front so it was 
>> simply specifying a file and that doesn't work either.  I have the 
>> appropriate file in the root of my webapp and in the WEB-INF 
>> directory and it still can't find the file.
>>
>> Can someone tell me where the file needs to be (or even better, how 
>> to specify that it's in the WEB-INF directory) please?
>>
>> Cheers,
>>    Rob.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>> For additional commands, e-mail: users-help@cocoon.apache.org
>>
>>
>


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


Mime
View raw message