I need to access some images with this URL http://localhost:8080/static/img1.jpg
The images are in "/home/andrea/Documents", the application context is "/". I'm using GlassFish 4.1.1.
In the /WEB-INF directory of project I've got the following: (glassfish-web.xml)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE glassfish-web-app PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Servlet 3.0//EN" "http://glassfish.org/dtds/glassfish-web-app_3_0-1.dtd">
<glassfish-web-app>
<parameter-encoding default-charset="UTF-8" />
<property name="alternatedocroot_1" value="from=/static/* dir=/home/andrea/Documents" />
</glassfish-web-app>
The problem is that, the file is not found.
What did I miss?
Is there another way to define alternatedocroot` or map a virtual directory outside the project?