The application I’m working on is deployed in Glassfish v3.1.1. I’m trying to use alternate document root to serve files from outside the war.
This is the content i have specified in glassfish-web.xml
<glassfish-web-app>
<context-root>xyz</context-root>
<property name="alternatedocroot_2" value="from=/new/\* dir=E:/xyz"/>
</glassfish-web-app>
The static files are stored in this location:
E:\xyz\new
After deployment,when the file is accessed using this url,I get a 404 response.
http://localhost:8080/xyz/new/1_RD_2.png
I did a search on how the requests are matched, and the above code seems to match with what was given here.
But still, the code doesn’t work. Is there something i’m missing or doing wrong here?
The above mentioned configurations were correct. The code dint work due to a conflicting url pattern mentioned in the web.xml
After changing the above pattern in web.xml to
the static files were accessible.