cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robin Wyles <...@robinwyles.com>
Subject Re: Cocoon Configuration API usage - how to get running mode?
Date Fri, 10 Oct 2008 11:06:20 GMT
Hi,

If I understand correctly you want to determine the value of the  
property "org.apache.cocoon.mode", am I right?

If so you can do it like this:

String mode = ((Settings) 
WebAppContextUtils.getCurrentWebApplicationContext().getBean 
(Settings.ROLE)).getProperty("org.apache.cocoon.mode");

Not pretty, but it works :)

Cheers,

Robin


On 10 Oct 2008, at 08:18, Perez Guerrero, Antonio Javier wrote:

> Hi,
>
> How can I read spring managed properties from Java, without  
> defining my classes as beans?
>
> I’ve tried using org.apache.cocoon.configuration.MutableSettings,  
> which has all the methods that I need... But I cannot instantiate  
> it because I don’t know how to determine the current running mode.  
> Any ideas on how to achieve it?
>
> Thanks in advance
>


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


Mime
View raw message