How to provide a context configuration for a web application in Tomcat?

前端 未结 6 1533
星月不相逢
星月不相逢 2020-12-04 08:30

I have a web application that relies on some resources and parameters to be configured after it is installed, like a JDBC connection.

What I have come up with is pro

6条回答
  •  南笙
    南笙 (楼主)
    2020-12-04 09:18

    @n0rm1e: not sure if tomcat provides any sort of solution for you problem. But one possible solution can be:- create an ant script with following steps:

    i) Check existence of .xml file in [engine-name]/[server-name] directory. If it exists, take a back up of this/rename it.

    ii) copy your war file to tomcat webapps. Restart tomcat server.

    iii) copy backup-ed configuration file back to [engine-name]/[server-name] directory

提交回复
热议问题