SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 98 | Next

Larry Brown, Marty Hall, and Yaakov Chaikin

"Core Servlets and JavaServer Pages, Volume 2"



Reporter
/*

For example, Listing 2.16 shows a portion of a web.xml file that associates the
ReportFilter filter with the servlet named PageName. The name PageName, in
turn, is associated with a JSP file named TestPage.jsp and URLs with the pattern
/UrlTest/*. The source code for TestPage.jsp and a discussion of the naming of
JSP pages were given earlier in Section 2.4 (Assigning Names and Custom URLs). In
fact, the servlet and servlet-name entries in Listing 2.16 are taken unchanged
from that section. Given these web.xml entries, you see debugging reports in the
standard output of the following sort (line breaks added for readability):
2.8 Specifying Welcome Pages 71
audit.irs.gov tried to access
http://mycompany.com/deployDemo/UrlTest7/business/tax-plan.html
on Tue Dec 25 13:12:29 EDT 2005.
2.8 Specifying Welcome Pages
Suppose a user supplies a URL like http://host/webAppPrefix/directoryName/ that
contains a directory name but no file name. What happens? Does the user get a
directory listing? An error? The contents of a standard file? If so, which one??”
index.html, index.jsp, default.html, default.htm, or what?
The welcome-file-list element, along with its subsidiary welcome-file
element, resolves this ambiguity. For example, the following web.xml entry specifies
that if a URL gives a directory name but no file name, the server should try index.


Pages:
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110