I created folder resources in %TOMCAT_HOME% for static resources (*.xml, *.properties, etc...).
The deploy of my app (app1) create in %TOMCAT_HOME%/resources the folder app1-resources with the own files *.xml, *.properties... of my app1.
In %TOMCAT_HOME%/conf/catalina.properties I added:
shared.loader=${catalina.base}/resources
But when I access to any file with the classpath:
(...)
<value>classpath:app1-resources/conf.properties</value>
(...)
Or:
(...)
@ImportResource("classpath:app1-resources/spring-config.xml")
(...)
It fail!!! Because not found resources...
If I change the configuration to:
shared.loader=${catalina.base}/resources/app1-resources
And change the access to those to:
(...)
<value>classpath:conf.properties</value>
(...)
Or:
(...)
@ImportResource("classpath:spring-config.xml")
(...)
It works.
My problem is if I deploy more than one app in the same tomcat, I want to access to the resources of each app independently. For example:
App1:
App2:
My question is: Can I specify a root directory which my resources lies underneath it (in a custom folder for each app)?
Anybody can solve my problem?
Thanks in advance.
在指定它shared.loader
或common.loader
财产/conf/catalina.properties
。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.