1. You use jsp-file instead of servlet-class. The servlet
element of the WEB-INF/web.xml file would look something like this:
InitPage
/InitPage.jsp
2.6 Initializing and Preloading Servlets and JSP Pages 61
...
...
...
2. You should assign the original URL of the JSP page as its custom
URL pattern. With servlets, it is moderately common to use a
custom URL pattern that differs from the name of the servlet. There
wouldn??™t be anything technically illegal in doing the same for JSP pages
as well. However, many users dislike URLs that appear to refer to regular
servlets when used for JSP pages. Furthermore, if the JSP page is in
a directory for which the server provides a directory listing (e.g., a directory
with neither an index.html nor an index.jsp file), the user might get
a link to the JSP page, click it, and thus accidentally invoke the uninitialized
page. Therefore, a good strategy is to use url-pattern (Section
2.4) to associate the original URL of the JSP page with the registered
servlet name. That way, clients can use the normal name for the JSP
page but still invoke the customized version. For example, given
the servlet definition from item 1, you might use the following
servlet-mapping definition:
InitPage
/InitPage.
Pages:
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99