How do you do servlet aliasing with Apache and Tomcat?
Created May 4, 2012
Serge Knystautas
Servlet aliasing is a two part process with Apache and Tomcat. First, you must map the request in Apache to Tomcat with the ApJServMount directive, e.g.,
ApJServMount /myservlet /ROOT
Second, you must map that url pattern to a servlet name and then to a servlet class in your web.xml configuration file. Here is a sample exerpt:
<servlet> <servlet-name>myservlet</servlet-name> <servlet-class>com.mypackage.MyServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>myservlet</servlet-name> <url-pattern>/myservlet</url-pattern> </servlet-mapping>