You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Xi Chen <ro...@gmail.com> on 2006/03/16 03:51:25 UTC
How to configure in Tomcat?
Hi, there. I have a question in my deployment under Tomcat 5.5.
In one of the java classes I wrote, I have a line of code like the following:
String propertiesFilePath = System.getEnv("MY_CONFIG_FILE_PATH");
// Then I start load the contents of the file into java Properties.
I set up the environment variable (MY_CONFIG_FILE_PATH) correctly on
the machine, and the class function all right if I test it via a
command line.
However, if I test the class under Tomcat (after deploy the class to
the appropriate path under Tomact) on the same machine, it complains
that it cannot find the path.
Given that result, I speculate that Tomcat has no way to know the
environment variables. Am I wrong? Is there anyway to configure
Tomact (e.g. setting a config variable like "MY_CONFIG_FILE_PATH"
under Tomcat), so that all the deployed knows the value of the
"MY_CONFIG_FILE_PATH".
All I want to achieve is that:
Put all the needed SQL queries in a properties file and let java
classes retrieve the queries from the properties file (in stead of
using hard-coded queries in the source code).
It seems to me to deploy the properties file under the Tomcat is a bit
challenging.
Any guidance will be highly appreciated!
--
Don Chen
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: How to configure in Tomcat?
Posted by foo shyn <fo...@optegra.com.my>.
It shouldn't be a problem for application to get system properties....tried
that before and it worked fine for me...
Is ur path a full path ? i mean is it something like "C:\......" or is it
just started with a slash like "\......"?
If it's started with a "\..." u need to put the specific file and the
folder(s) that contains it in the Tomcat folder, otherwise it should be
working fine...
my 2 cents, and hope it helps.
FooShyn
----- Original Message -----
From: "Xi Chen" <ro...@gmail.com>
To: <us...@tomcat.apache.org>
Sent: Thursday, March 16, 2006 10:51 AM
Subject: How to configure in Tomcat?
Hi, there. I have a question in my deployment under Tomcat 5.5.
In one of the java classes I wrote, I have a line of code like the
following:
String propertiesFilePath = System.getEnv("MY_CONFIG_FILE_PATH");
// Then I start load the contents of the file into java Properties.
I set up the environment variable (MY_CONFIG_FILE_PATH) correctly on
the machine, and the class function all right if I test it via a
command line.
However, if I test the class under Tomcat (after deploy the class to
the appropriate path under Tomact) on the same machine, it complains
that it cannot find the path.
Given that result, I speculate that Tomcat has no way to know the
environment variables. Am I wrong? Is there anyway to configure
Tomact (e.g. setting a config variable like "MY_CONFIG_FILE_PATH"
under Tomcat), so that all the deployed knows the value of the
"MY_CONFIG_FILE_PATH".
All I want to achieve is that:
Put all the needed SQL queries in a properties file and let java
classes retrieve the queries from the properties file (in stead of
using hard-coded queries in the source code).
It seems to me to deploy the properties file under the Tomcat is a bit
challenging.
Any guidance will be highly appreciated!
--
Don Chen
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org