Search code examples
htmlglassfishapplication-server

How can I simply expose local .html files via web browser using an application server (Glassfish)?


Lets say I have a directory of .html files, accessible by the app server, and I want to display to users so they can access them with their browser:

/import/tps-reports/index.html
/import/tps-reports/report1.html
/import/tps-reports/report2.html

Is there a way I can expose the tps-reports directory to do this so that a user can access them via:

http://www.example.com/tps-reports/index.html
http://www.example.com/tps-reports/report1.html

Also, keep in mind that index.html may reference the other pages:

<a href="report1.html">Report 1</a>

So those links need to work as well.


Solution

  • Here is a possible answer:

    http://docs.oracle.com/cd/E19776-01/820-4496/geqpl/index.html

    You can set up an alternate doc root so that certain URI patterns point to different paths.

    The examples are only really showing relative paths though...I wonder if its "ok" to use this to reference local file systems.