I have a JSF 2.0 application running under Glassfish 3.1.1 and I need to serve static web pages that are physically located apart from my application root that is created wh
This exact configuration requires a /images/myimages
folder relative to the absolute root of the same disk as where the JVM of the webserver is running in. A file foo.png
in that folder is then available by http://localhost:8080/contextname/myimages/foo.png
.
A common confusion around this setting is that the from
attribute is been interpreted as alone the context path in URL and not as an actual subfolder in the dir
location. But this is thus not true.
If you're running Glassfish on a Windows environment then you need to specify the disk letter in the dir
as well like so dir=C:/images
.