Question

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

Était-ce utile?

La solution

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\

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top