1

I am trying to migrate a web app from Jboss to Tomcat server. The webapp is dependent on the spring container and nothing else. In the context config file, I am referring to some of the property files as follows:

<entry key="passwordFile" value="jbossconf:passwords.xml"/>

Here the jbossconf refers to the configuration folder present in $jboss_home/server/conf folder.

When I am trying to move this web app to Tomcat, I need to use

<entry key="passwordFile" value="classpath:passwords.xml"/>

Is there any way to define a variable in tomcat like "tomcatconf" and make tomcat look for the configuration files inside this folder. Something like

<entry key="passwordFile" value="tomcatconf:passwords.xml"/>

The reason I am trying to do so is to avoid the mixing up of configuration files and the class files inside the same directory in my web app. If i put the configuration files inside classpath, then all the class files and the config files will be placed under WEB-INF/classes which I feel is not a good practice.

Alternate approach/suggestions for implementing this is most welcome.

Thanks, Vishwa

4

1 回答 1

0

如果tomcat不在同一台机器上,您可以使用环境变量来定义配置目录的根目录,这样您就可以迁移应用程序而无需更改任何代码

于 2012-12-11T18:35:43.110 回答