开发者

tomcat relative paths settings

开发者 https://www.devze.com 2023-02-15 03:08 出处:网络
I have deployed a app on tomcat. Some of the lib开发者_开发问答raries used by the app use relative paths to resources. Therefore, they search the resources in TOMCAT-HOME/relative-path.

I have deployed a app on tomcat. Some of the lib开发者_开发问答raries used by the app use relative paths to resources. Therefore, they search the resources in TOMCAT-HOME/relative-path. I can not create links nor copy resources to TOMCAT-HOME folder. Also I can not change the code of the libraries and use application context. Can I somewhere in Tomcat configuration specify the "working directory" for this app alone. I've tried using Context container, but I can not get my head around it. Thanks.


You need something like this inside your server.xml

<Context cachingAllowed="false" docBase="C:\ProgramFiles\ApacheSoftwareFoundation\apache-tomcat-5.5.29\temp" path="/tmpimages" privileged="true">
  </Context>

and use /tmpimages inside your source code.


From the question you have asked , i can understand that you have problems accessing the TOMCAT-HOME folder . Why dont you try adding a ../ in front of all the paths that wants to access the TOMCAT-HOME folder ?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号