How do you do servlet aliasing with Apache and Tomcat?

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>

0 Comments  (click to add your comment)
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact