Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
402 views
Welcome To Ask or Share your Answers For Others

1 Answer

You should use

<property description="Uploaded Images" name="alternatedocroot_1" value="from=/uploads/* dir=C:Test" />

and then drop your images into C:Testuploads

or, for example, use

<property description="Uploaded Images" name="alternatedocroot_1" value="from=/uploads/* dir=C:" />

and then drop your images into C:uploads


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...