Simple Welcome Servlet Hack

Starting in Servlet Spec 2.4, servlet mappings can be used as welcome-entries. Previously, there was no spec compliant way to do this. This example shows a simple way around the issue.
(By having an empty file with the same name as a url-pattern from a servlet mapping, and having that file listed as a welcome file, you can trick the container into serving up your servlet as a welcome file)

To Run:

  1. Download SimpleWelcomeServletHack.war to your TOMCAT_INSTALL/webapps directory.
    If you're using MSIE, make sure it doesn't change the extension to ".zip".
  2. Then, click on this link:
    http://localhost:8080/SimpleWelcomeServletHack