You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by hbhartee <hi...@yahoo.co.uk> on 2009/11/18 15:20:58 UTC

Re: Location of properties file for web app in Tomcat

Hi,

There is a simple way of using properties file across different web
applications in Tomcat.

> Jar the properties file (included in package folders) and drop it in
> jakarta-tomcat/common/lib directory
> If you do not want to jar, just drop the properties file (included in
> relevant package structure folders) to jakarta-tomcat/common/classes

The properties file would be available to all web applications after Tomcat
is restarted.

R, 
-- 
View this message in context: http://old.nabble.com/Location-of-properties-file-for-web-app-in-Tomcat-tp21767095p26408179.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Location of properties file for web app in Tomcat

Posted by Ziggy <zi...@gmail.com>.
I had the same problem before. I didnt want to configure the location of the
properties file at the tomcat instance level since i had more than one war
file. What i ended up doing is add the properties file configuration on the
application's context file. This meant each war file can point to its own
properties file.

Here is what i do. I add the following line in my META-INF/context.xml file.
(The path can be anywhere on the system)

<Environment name="APP_PROPERTIES"
        description="The APP Properties File" override="false"
        type="java.lang.String"
        value="/u/misc/web/conf/app.properties" />


Then in my code i just access the path using the following code

System.getenv("APP_PROPERTIES");


Note: On a windows environment just change the path to the windows
equivalent


Thanks
HTH






On Wed, Nov 18, 2009 at 2:20 PM, hbhartee <hi...@yahoo.co.uk>wrote:

>
> Hi,
>
> There is a simple way of using properties file across different web
> applications in Tomcat.
>
> > Jar the properties file (included in package folders) and drop it in
> > jakarta-tomcat/common/lib directory
> > If you do not want to jar, just drop the properties file (included in
> > relevant package structure folders) to jakarta-tomcat/common/classes
>
> The properties file would be available to all web applications after Tomcat
> is restarted.
>
> R,
> --
> View this message in context:
> http://old.nabble.com/Location-of-properties-file-for-web-app-in-Tomcat-tp21767095p26408179.html
> Sent from the Tomcat - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>