tomcat 相对路径设置 [英] tomcat relative paths settings

查看:105
本文介绍了tomcat 相对路径设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在 tomcat 上部署了一个应用程序.应用程序使用的一些库使用资源的相对路径.因此,他们在 TOMCAT-HOME/relative-path 中搜索资源.我无法创建链接或将资源复制到 TOMCAT-HOME 文件夹.此外,我无法更改库的代码并使用应用程序上下文.我可以在 Tomcat 配置中的某个地方单独为这个应用程序指定工作目录"吗?我试过使用 Context 容器,但我无法理解它.谢谢.

I have deployed a app on tomcat. Some of the libraries 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.

推荐答案

你的 server.xml

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

并在源代码中使用 /tmpimages.

这篇关于tomcat 相对路径设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆