备用的docroot无法在glassfish上工作4 [英] Alternate docroot not working on glassfish 4
问题描述
我试图设置一个备用文档根目录来提供上传的文档。我在我的glassfish web xml中包含了以下内容:
pre $ lt; code>< context-root> / dom< / context-root>
< property description =Uploaded Imagesname =alternatedocroot_1value =from = / uploads / * dir = C:/ Test/>
然后我在Test文件夹中存储了一个名为cars.pdf的测试pdf。
要访问它,我在浏览器中输入以下内容:
http:// localhost :8080 / uploads / cars.pdf
然而,这只是给我一个404错误,在这里搜索,但似乎没有任何工作。有人可以告诉我什么是做错了吗?
感谢史蒂夫
您应该使用
< property description =Uploaded Imagesname =alternatedocroot_1value =from = / uploads / * dir = C:\Test\/>
然后将图片放入 C:\Test\uploads\\ \\ / code>
或者,例如,使用
< property description =Uploaded Imagesname =alternatedocroot_1value =from = / uploads / * dir = C:\/>
然后将图片放入 C:\uploads\
Im trying to set-up an alternate docroot in order to serve uploaded documents from. I have included the following in my glassfish web xml
<context-root>/dom</context-root>
<property description="Uploaded Images" name="alternatedocroot_1" value="from=/uploads/* dir=C:/Test" />
I have then stored a test pdf in the Test folder called cars.pdf.
To access it i am typing the following into my browser
http://localhost:8080/uploads/cars.pdf
This however simply gives me a 404 error, ive tried googling and searching about here but nothing seems to work. Can some tell me what im doing wrong?
Thanks Steve
You should use
<property description="Uploaded Images" name="alternatedocroot_1" value="from=/uploads/* dir=C:\Test\" />
and then drop your images into C:\Test\uploads\
or, for example, use
<property description="Uploaded Images" name="alternatedocroot_1" value="from=/uploads/* dir=C:\" />
and then drop your images into C:\uploads\
这篇关于备用的docroot无法在glassfish上工作4的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!