How to serve static web pages from a JSF application using Glassfish

前端 未结 1 862
说谎
说谎 2021-01-15 01:23

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

相关标签:
1条回答
  • 2021-01-15 02:01

    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.

    0 讨论(0)
提交回复
热议问题