This is version 11. It is not the current version, and thus it cannot be edited.
[Back to current version]   [Restore this version]

<welcome-file>

This tag specifies the relative path of a single welcome file.

A welcome file is provided when the web application is accessed using only the domain name, or with any other URL that ends with a slash.

Welcome files must exist as physical files in your application, or in Servlets 2.4 and above can also be servlets that are defined in web.xml.

The page or servlet should be specified without any leading slash. Only relative paths can be specified.

Example 1: a shockwave file in your application root folder

    <welcome-file>splash.swf</welcome-file>

Example 2: a JSP file at /info/help.jsp (the path info/help.jsp becomes relative to whichever folder is accessed, so this is not recommended for use as the only welcome-file in the list)

    <welcome-file>info/help.htm</welcome-file>

Example 3: using a servlet with a <url-pattern> of /MyServlet

    <welcome-file>MyServlet</welcome-file>

Example 4: using a servlet with a <url-pattern> of /servlet/MyServlet. Note that like Example 2, this path is relative, so if the user attempts to access http://<domainName>/<appName>/someFolder, this won't work unless you also have a mapping for /someFolder/servlet/MyServlet

    <welcome-file>servlet/MyServlet</welcome-file>

See Also

navigation
metawerx specific
search
Share
tools
help

referring pages

Share