Adding external folders path to server to access the images from glassfish

728 Views Asked by At

I am trying to access external folder from my Restful webservices. I want to get the images of the external folder from in the HTTP get. I have tried configuring the web.xml but it did not work for glass fish.

Could some one please help me add the path of the folder C:/documents/images to xml so that I can access them from http://localhost/api/pictures

I have a servlet running, I can get the database data but I am finding hard time mapping the external folder in web.xml.

1

There are 1 best solutions below

0
Tadas B. On

add "Alternate Document Roots" configuration to glassfish-web.xml to external folder:

property description="Uploads" name="alternatedocroot_1" value="from=/img/* dir=c:\Temp"

put images to c:\Temp\img folder and URL should be: http://localhost/project/img