tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "George McKinney" <geo...@tantalus.com>
Subject RE: Properties file declaration
Date Tue, 26 Feb 2002 23:33:14 GMT



> -----Original Message-----
> From: Ursula Pieper [mailto:ursula@guitar.rockefeller.edu]
> Sent: Tuesday, February 26, 2002 2:06 PM
> To: Tomcat Users List
> Subject: Re: Properties file declaration
>
>
>
> 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
> file.
>
> I'd really like to do this using the parameter directive
> (Problem still
> described below), also to make it compatible to my collaborator.
>
> Anyone?
>
...
> |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" );
> |	...
> |
I think that if you use
	if(servletContext.getInitParameter("CONFIG_FILE") == null);
etc.

you'll get what you want. That method is doc'd in jdk 1.3.1, but NOT in my
"Enterprise in a Nutshell"

George.


--
To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>


Mime
View raw message