Java Web App Context⇑
Description
Many people running Java applications use the servlet engine to serve static content as well. But no servlet engine is nearly as efficient as LiteSpeed Web Server for these processes. In order to improve the overall performance, LiteSpeed Web Server can be configured as a gateway server, which serves static content and forwards dynamic Java page requests to the servlet engine.
LiteSpeed Web Server requires certain contexts to be defined in order to run a Java application. A Java Web App Context automatically creates all required contexts based on the Java web application's configuration file (WEB-INF/web.xml).
There are a few points you need to keep in mind when setting up a Java Web App Context:
- A Servlet Engine external application must be set up in External Apps before Java Web App Context can be set up.
- A Script Handler for .jsp files should be defined as well.
- If the web application is packed into a .war file, the .war file must be expanded. The server cannot access compressed archive files.
- For the same resources, the same URL should be used no matter whether it is accessed through LiteSpeed Web Server or through the servlet engine's built-in HTTP server.
For example, Tomcat 4.1 is installed under /opt/tomcat. Files for the "examples" web application are located at /opt/tomcat/webapps/examples/. Through Tomcat's built-in HTTP server, the "examples" web application is thus accessed with a URI like "/examples/***". The corresponding Java Web App Context should thus be configured: URI = /examples/, Location = /opt/tomcat/webapps/examples/.