This sample application bundles a JAR file, namely jarresource-javaee6-jar-3.0-M1.jar in its WEB-INF/lib directory and the sample application contains both dynamic and static resources(index.html, head.html, jarresource.jsp) in its META-INF/resources directory. All these resources can be accessed as if they are in the application's root directory. Prior to Servlet 3.0, this may result in a 404 response.
Once the resources are requested, it will first search the root of the web application context for the requested resource before looking at any of the JAR files in the WEB-INF/lib directory. The order in which the JAR files in the WEB-INF/lib directory are scanned is undefined.
The full-blown of the application structure is depicted as the following:
web.xml specifies the welcome file list, we use index.html as enclosed by <welcome-files/> tags in the sample.
geronimo-web.xml specifies the module's dependency information and entry point of the application.
Information about the project such as module's unique name, dependencies is described inside the <sys:environment/> tags. It is one of the best practices to give your module an unique identification, so that it can later be referenced by some other deployable applications. In our sample application, the module is grouped as org.apache.geronimo.samples. The path specified in the <context-root/> tags is the entry point of the URL used to access this web application. Therefore the sample application can be accessed at http://<hostname>:<port>/jarresource-javaee6.
index.html is placed in the META-INF/resources directory of the JAR file which is then bundled in the WEB-INF/lib directory of this jarresource-javaee6 application.
The <frameset> tag in index.html defines a frameset.The frameset element holds two frame elements which indicate two separate documents header.html and jarresource.jsp.
jarresource.jsp is used to render output on the screen.
The remote host is <%=request.getRemoteHost()%>.