简体   繁体   English

使用Eclipse和AppEngine的web.xml中的相对路径

[英]Relative paths in web.xml with Eclipse and appengine

I want to reference a local file for web-app_2_3.dtd in my web.xml file, but can't find a way to use a relative path. 我想在我的web.xml文件中引用web-app_2_3.dtd的本地文件,但是找不到使用相对路径的方法。 Since this file is used on multiple machines the relative path is important. 由于此文件用于多台计算机,因此相对路径很重要。

I put the dtd file I want to use in the WEB-INF directory (with web.xml) and have tried to reference it with things like "web-app_2_3.dtd" and "war/WEB-INF/web-app_2_3.dtd" and every permutation and depth of things like that I can think of. 我将要使用的dtd文件放在了WEB-INF目录(带有web.xml)中,并尝试用“ web-app_2_3.dtd”和“ war / WEB-INF / web-app_2_3.dtd”之类的东西引用该文件。以及我能想到的事物的各种排列和深度。

Is there a variable I can use to reference the war directory, or something? 是否可以使用变量引用war目录?

我发现web.xml中的路径是相对于webroot的,因此,如果它在WEB-INF中,则相对路径将类似于/WEB-INF/web-app_2_3.dtd ,而无需使用war /它的前面

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM