我使用REST Web服务(不在glassfish中)创建了一个xml文件,然后我需要一个位于glassfish里面的quercus内的php文件才能访问这个文件来修改它。但是我无法将文件复制到glassfish中,因为它受到保护,我似乎无法从内部访问glassfish之外的任何文件。
关于使用备用文档根目录(例如this answer或 this document)有很多话题,但我找不到如何实现它。他们都说要查找sun-web.xml
文件或glassfish-web.xml
文件并进行编辑,但我的glassfish服务器中没有这些文件。我也试过通过像website这样的网络界面来做这件事,但这也不起作用。
还有其他人知道我能尝试什么吗?
答案 0 :(得分:1)
glassfish-web.xml
(以前称为sun-web.xml
)应放入您的网络应用程序的.war文件的WEB-INF/glassfish-web.xml
。这就是为什么在浏览服务器目录时无法找到它。
配置备用docroots可让您的应用程序提供来自其他位置的文件。
我添加一个文件示例以防万一,但这部分你可能已经知道了
<glassfish-web-app ...>
...
<property name="alternatedocroot_1" value="from=/my.jpg dir=/srv/images/jpg"/>
<property name="alternatedocroot_2" value="from=*.jpg dir=/srv/images/jpg"/>
<property name="alternatedocroot_3" value="from=/jpg/* dir=/src/images"/>
</glassfish-web-app>
查看扩展文档: http://docs.oracle.com/cd/E18930_01/html/821-2418/beaft.html#geqpl