Again, note that this entry is in the Tomcat-specific web.xml file that is stored in
install_dir/conf, not the standard web.xml file that is stored in the WEB-INF directory
of each Web application.
Figure 2??“11 shows the result when the TestServlet1 (Listing 2.1 from Section
2.4) is invoked with the default URL in a version of Tomcat that has the invoker servlet
globally disabled. The default URL fails.
Please see http://www.coreservlets.com/ for more information on setting up
Tomcat.
Chapter 2 ?– Controlling Web Application Behavior with web.xml 56
Figure 2??“11 TestServlet1 when invoked with the default URL in a server that has
globally disabled the invoker servlet.
2.6 Initializing and Preloading
Servlets and JSP Pages
This section discusses methods for controlling the startup behavior of servlets and
JSP pages. In particular, it explains how you can assign initialization parameters and
how you can change the point in the server life cycle at which servlets and JSP pages
are loaded.
Assigning Servlet Initialization Parameters
You provide servlets with initialization parameters by means of the init-param element,
which has param-name and param-value subelements. For instance, in the
following example, if the InitServlet servlet is accessed by means of a URL in
the f o rm of http://host/webAppPref i x/showI n i tValues, i t co uld ca l l
getServletConfig().
Pages:
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94