Sorry for the confusion
Shapira, Yoav wrote:
Howdy,
Your context constructor? What's that? Last I checked,
javax.servlet.ServletContext was an interface, and the container
provides an implementation.
If you want to tie into the context lifecycle, which is a very valid
design, use a ServletContextListener implementation. The context
parameters are available in that listener's contextInitialized() method.
Yoav Shapira
Millennium ChemInformatics
-----Original Message----- From: Mike Roest [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 16, 2003 1:49 PM To: [EMAIL PROTECTED] Subject: Question about context-paramHi all, I'm trying to initialize a few parameters from my web.xml to be available to my context. I'm just wondering when they become available. As I'm attempting to access them during my Context constructor and I'm getting to following exception trace. (This call was just trying to get the names not actually access the values but trying to access the values give similar results) java.lang.NullPointerException at javax.servlet.GenericServlet.getInitParameterNames(GenericServlet.java:167)at polaris.servlet.PolarisContext.<init>(PolarisContext.java:54) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(NativeMethod)at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:274) at java.lang.Class.newInstance0(Class.java:296) at java.lang.Class.newInstance(Class.java:249) atorg.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:902) atorg.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:821)at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3420) atorg.apache.catalina.core.StandardContext.start(StandardContext.java:3608) atorg.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)at org.apache.catalina.core.StandardHost.start(StandardHost.java:738) atorg.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)atorg.apache.catalina.core.StandardEngine.start(StandardEngine.java:347) atorg.apache.catalina.core.StandardService.start(StandardService.java:497) atorg.apache.catalina.core.StandardServer.start(StandardServer.java:2189) at org.apache.catalina.startup.Catalina.start(Catalina.java:512) at org.apache.catalina.startup.Catalina.execute(Catalina.java:400) at org.apache.catalina.startup.Catalina.process(Catalina.java:180) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203) The only thing I can think of is that the context-param isn'taccessableuntil after the context constructor is finished. Which makes it not very helpfull for me. If anyone has another way of doing this without putting it into a properties file I'm interested. (The whole point of this is we're trying to migrate our properties toDBtables and need to give the app the DB user and password) Thanks -- To unsubscribe, e-mail: <mailto:tomcat-user- [EMAIL PROTECTED]> For additional commands, e-mail: <mailto:tomcat-user- [EMAIL PROTECTED]>-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>