Welcome files not working


Added by Greg Wilkins, last edited by Dexter Ang on Feb 19, 2008  (view change)

Labels:

Enter labels to add to this page:
Wait Image 
Looking for a label? Just start typing.
Contact the core Jetty developers at www.webtide.com
private support for your internal/customer projects ... custom extensions and distributions ... versioned snapshots for indefinite support ... scalability guidance for your apps and Ajax/Comet projects ... development services from 1 day to full product delivery

Do welcome files need to exist?

The welcome file mechanism allows a request to /some/directory/ to be served by the contents of a file like /some/directory/index.html.

If there is a servlet mapped to handle the welcome file, it will be called. So if index.jsp is configured as a welcome file, then a request to /some/directory/ will be passed to the JspServlet mapped at *.jsp to handle the /some/directory/index.jsp file.

However, the file MUST exist for the welcome file mechanism to work. Even if index.do is defined as a welcome file, then a request to /some/directory/ will not be passed to a servlet handling *.do for some/directory/index.do UNLESS THE FILE EXISTS.

If you want an index to be served by a servlet, then I suggest you use a filter
to do the redirection. See the WelcomeFilter.java for an example.