Hi J�rg,
I think that you can pass a Context to the FortressConfig, and FortressConfig
have a static method createDefaultConfig(ClassLoader):Context that creates the
base context for FortressConfig. So this should work:
Context fortressContext =
createDefaultConfig( Thread.currentThread().getContextClassLoader() );
MyContextWrapper context =
new MyContextWrapper(getSerlvetConfig(), fortressContext);
FortressConfig config = new FortressConfig(context);
with
public class MyContextWrapper
{
public MyContextWrapper(ServletConfig config, Context parentContext)
{
// ...
}
// ...
public Object get(Object key) throws ContextException
{
if (m_config.getInitParameter(key.toString()) != null)
return m_config.getInitParameter(key.toString());
if (m_parentContext.get(key) != null)
return m_parentContext.get(key);
throw new ContextException("No such key");
}
}
Not sure it is the correct usage patterns... but it is correct.
Cheers, A+. Didier.
> Hi Leo,
>
> may be I am getting something wrong here. FortressConfig is not a
> Configuration
> at all, but mainly a wrapper for a Context object. For my components I
> am
> currently not certain which informartion from the ServletConfig will be
> used when.
> It is very likely I have to use Servlet parameters during the service
> call of a
> container component. Therefore I would like to put the ServletConfig
> into the
> context of my root container ... which seems not to be possible :(
>
> Regards,
> J�rg
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]