How the Container chooses a welcome file

  1. Client requests: http://www.wickedlysmart.com/MyTestApp/search

    image with no caption
  2. Container looks in the DD for a servlet mapping, and doesn’t find a match. Next, the Container looks in the <welcome-file-list> and sees “index.html” at the top.

    image with no caption
  3. Container looks in the /MyTestApp/search directory for an “index.html” file, but does not find one.

    image with no caption
  4. Container looks at the next <welcome-file> in the <welcome-file-list> in the DD, and sees “default.jsp”.

    image with no caption
  5. Container looks in the /MyTestApp/search directory for a “default.jsp” file, finds one, and serves its response to the client.

    image with no caption

Get Head First Servlets and JSP, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.