[opencms-dev] module action class static initialization

Nacho Fernández Orellana nacho.fernandez.orellana at gmail.com
Wed Sep 30 14:34:41 CEST 2009


Hi list,

I have a module whose action class initializes in a static block a static
variable that depends on another module's parameter. I have hints that point
to the theory that this is not working properly, I am quite sure it is
because that other module's parameters are not available at the time this
module initializes. Is that possible?

My code looks like:

static {
....
        var = OpenCms.getModuleManager().getModule( "other.module"
).getParameter( "other_var", "default_var" );
....
}

Is this code bound to fail always, or there is some approach that can
guarantee the "other.module" is loaded and their parameters available by the
time the static block of this action class is called? Thank you in advance
for any hints/thoughts. Greetings,

Nacho Fernandez.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20090930/f3de5db8/attachment.htm>


More information about the opencms-dev mailing list