Alternate docroot Does Not Work For The Default Web Module If Set Using Admin Console Or domain.xml File In Oracle GlassFish Server
Last updated on NOVEMBER 05, 2016
Applies to:Oracle GlassFish Server - Version 3.1.2 and later
Information in this document applies to any platform.
The alternate docroot is set in the Admin GUI as follows under instance-config ->Virtual Server->Server
and a new property "alternatedocroot_1" is added with the following values:
This alternatedocroot_1 will cause access to the URI like "/images/sample.jpg" to serve the static image file located as "C:/Temp/MyImages/images/sample.jpg.
Now a sample application "hello" (hello.war) is deployed to use images from the above directory. This works fine if the hello application is accessed as http://<host:port>/hello. In fact, the images located under /images can be accessed directly through the browser as http://<host>/images/sample.jpg
However, when the "hello" application is set as the default web application (or deployed with context-root as "/") from the virtual server. the images are no longer accessible. It behaves as the alternate docroot for "/images/*" is lost.
Sign In with your My Oracle Support account
Don't have a My Oracle Support account? Click to get started
My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms