user771912
user771912

Reputation: 411

External configuration file

I'm working on a spring-mvc project and was wondering if, like grails, I can create an external configuration file in tomcat with the appconfig folder. My project lives in /var/lib/tomcat7/webapps/<app> and was wondering if placing a configuration file in /var/lib/tomcat7/appconfigs/<config.xml> would work? If so, is it like grails and the application searches that location by default, or do I need to specify where that configuration lives? Thanks

Upvotes: 0

Views: 454

Answers (1)

Jigish
Jigish

Reputation: 1784

What do you mean by "external configuration file"? Would this config file be separate from the war file? Or would it be packaged along with war file?

If packaged along with war file, you can put it under src/main/resources folder and it should be automatically packaged and placed in classpath.

If not packaged with war file, I usually put the configuration parameters under Tomcat's context.xml. Here's the documentation: http://tomcat.apache.org/tomcat-7.0-doc/config/context.html#Environment_Entries

Upvotes: 1

Related Questions