gpt4 book ai didi

java - 访问应用程序包外的文件夹(.ear/.war 文件)

转载 作者:塔克拉玛干 更新时间:2023-11-02 07:58:13 24 4
gpt4 key购买 nike

有什么方法可以使未打包在 war 文件中的文件夹可以通过 GET 访问。

可能在 web.xml 中设置了什么?

最佳答案

是的,您可以使用 alternatedocroot 属性(在 Glassfish 中) 从 war 之外提供文件(如图像)。

This property can be a subelement of a sun-web-app element in the sun-web.xml file or a virtual-server element in the domain.xml file

参见此处:http://docs.sun.com/app/docs/doc/820-4496/geqpl?l=en&a=view

例子:

<property name="alternatedocroot_1" value="from=/images/* dir=/usr/gifs"/>

关于java - 访问应用程序包外的文件夹(.ear/.war 文件),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3109527/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com