tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ursula Pieper <>
Subject Re: Properties file declaration
Date Tue, 26 Feb 2002 22:05:41 GMT

Thanks Sriram for the suggestion of loading the properties file from 
within the servlet. Unfortunately, that would involve changing and 
recompiling about 20 or more scripts, since all of them use the properties 

I'd really like to do this using the parameter directive (Problem still 
described below), also to make it compatible to my collaborator. 


Thanks, ursula


|my servlets need to access a properties file 
|I tried to get the parameter to read properly by adding parameter entries 
|at different location. so now:
|My server.xml entry looks like this:
|<Context path="/application" docBase="application" debug="9" 
|<Parameter name="CONFIG_FILE" 
|and the web.xml:
|This entry gets recognized at tomcat startup:
|in catalina.out: 
|XmlMapper: org.apache.catalina.core.StandardContext.addParameter( 
|The call for is in the servlet looks like this:
|init(ServletConfig config)
|throws ServletException
|    {
|            super.init(config);
|        try
|        {
|             configPrefs = new Properties();
|             servletContext = config.getServletContext();
|             if ( config.getInitParameter("CONFIG_FILE") == null )
|             throw new ServletException( "No CONFIG_FILE param" );
|	...
|and I am getting the following error message:
|javax.servlet.ServletException: No CONFIG_FILE param
|Can anybody help me straighten this out?
|I am new to this and want to get this application to run. I am just now 
|learning java and tomcat, so please excuse my probably trivial question. 
|I am running 
|Tomcat 4.0.1
|on redhat 7.2

To unsubscribe:   <>
For additional commands: <>
Troubles with the list: <>

View raw message