You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by alexis <al...@gmail.com> on 2011/01/25 15:15:51 UTC
how to access tomcat conf dir from my webapp
Hello, usually i store my custom config files in WEB-INF, but i need now to store a file (a binary file containing a license for my app) inside the tomcat conf dir. Main purpose for this is avoid the need to rebuild a war every time i license a different customer.
So, in this way, application to be deployed is always the same, and i can send the license file separately that can be read when tomcat starts or app is deployed.
thanks in advance.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: how to access tomcat conf dir from my webapp
Posted by Konstantin Kolinko <kn...@gmail.com>.
2011/1/25 Stevo Slavić <ss...@gmail.com>:
> String tomcatHomePath = System.getenv("CATALINA_HOME");
The above works only when starting Tomcat with .sh/.bat files and only
when CATALINA_BASE does not differ from CATALINA_HOME (see
RUNNING.txt).
The correct alternative would be to use System.getProperty("catalina.base");
Best regards,
Konstantin Kolinko
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: how to access tomcat conf dir from my webapp
Posted by Stevo Slavić <ss...@gmail.com>.
String tomcatHomePath = System.getenv("CATALINA_HOME"); // or
CATALINA_BASE, where CATALINA_HOME/CATALINA_BASE is name of
environment variable set to point to tomcat installation home or
instance base
java.io.File tomcatConfDir = new java.io.File(tomcatHomePath, "conf");
Regards,
Stevo.
On Tue, Jan 25, 2011 at 3:15 PM, alexis <al...@gmail.com> wrote:
> Hello, usually i store my custom config files in WEB-INF, but i need now to store a file (a binary file containing a license for my app) inside the tomcat conf dir. Main purpose for this is avoid the need to rebuild a war every time i license a different customer.
>
> So, in this way, application to be deployed is always the same, and i can send the license file separately that can be read when tomcat starts or app is deployed.
>
> thanks in advance.
>
>
>
> ---------------------------------------------------------------------
> 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