Welcome file Configuration in web.xml

Topic

Use of Welcome file Configuration in web.xml file for JSP?

Explanation

Welcome file list XML tag of the web.xml file is used to specify the default page of a web application if none is specified .This tag can have any number of "<welcome-file>" tags.

Example:


<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>

</web-app>

In the above example the file "index.jsp" are used as the welcome pages for the web application.