The Servlet and JSP specifications do not guarantee that a web application’s resources will be represented as files in the host machine’s file system. Many web container implementations do expand web applications into the file system, and some existing web applications take advantage of this implementation detail to reference resources as Java Files. However, web applications that target a Lotus® Expeditor runtime are represented as JAR bundles that do not have to be expanded in the file system to run.
Because of this, your web application should use the ServletContext.getResourceAsStream()
API when accessing web application resources. It should not assume these resources will be available as files. The API ServletContext.getRealPath()
should also not be used as it is implementation dependant. For the Lotus Expeditor runtime, it will return null since the web application resources are not expanded in the file system. Again, such resources can be accessed as IO streams through ServletContext.getResourceAsStream()
Parent topic: Accessing Web application resources: XPD621