Never mind, I found it...

// ServletContextEvent sce
sce.getServletContext().getInitParameter("myParam")

It was a little less than obvious because when you see a method
getInitParameter() of a SERVLET context, at least my interpretation is
that I am accessing the init params of a <servlet> element (and in fact
that's how you get those parameters, which we all already knew).  But, it
seems the container adds context parameters to the servlet param'
collection, or else does a lookup to the context when you get a param from
the servlet.

In any case, that's the answer, and thanks for playing :)

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com

On Tue, May 17, 2005 2:06 pm, Frank W. Zammetti said:
> Not really Struts-related, but there's some smart folks here, so...
>
> You can have a <context-param> element under <web-app> in web.xml, and
> this is perfect for a task I have (I'm initializing some things in a
> ServletContextListener that have to be initialized even before
> ActionServlet initializes - see, it IS Struts-related, sort of!)...
>
> My question is, how does one access these parameters?  I can't seem to
> find it... you get a ServletContextEvent in the listener, and from this
> you can get ServletContext, but that seems to be a level too low.
>
> What overly-obvious thing am I missing?  Thanks all!
>
> --
> Frank W. Zammetti
> Founder and Chief Software Architect
> Omnytex Technologies
> http://www.omnytex.com
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to