This is a step by step slides to study servlet, all the concepts which are required for a servlet are present in this ppt. The whole Servlet is divided into SESSIONS.
2. Welcome File in Servlet
1. The welcome-file-list element of web-app, is used to define a list of
welcome files.
2. A welcome file is the file that is invoked automatically by the server, if
you don't specify any file name. By default server looks for the
welcome file in following order:
a. welcome-file-list in web.xml
b. index.html
c. index.htm
d. index.jsp
If none of these files are found, server gives 404 error.
3. 1. If you have specified welcome-
file in web.xml, and all the files
index.html, index.htm and
index.jsp exists, priority goes to
welcome-file.
2. If welcome-file-list entry doesn't
exist in web.xml file, priority goes
to index.html file then index.htm
and at last index.jsp file.
Order of Execution
4. Let's see the web.xml file that defines the welcome files.
web.xml
<web-app>
....
<welcome-file-list>
<welcome-file>home.html</welcome-file>
<welcome-file>default.html</welcome-file>
</welcome-file-list>
</web-app>
Now, home.html and default.html will be the welcome files