Adding a directory to tomcat classpath and read the property file in spring

后端 未结 3 355
梦毁少年i
梦毁少年i 2021-02-03 23:29

I am trying to read the test1.properties file which is located at an external folder.

here is my spring config file:



        
3条回答
  •  盖世英雄少女心
    2021-02-04 00:23

    Use setenv.sh in the bin directory. If the file doesn't exist, create it. To add something to the classpath use the following syntax:

    CLASSPATH=/yourdir/
    

    For windows: setenv.bat

    Solution: creating the setenv.bat file under tomcat bin folder helped me in WINDOWS.

提交回复
热议问题