Java Reference
In-Depth Information
Had we done this for our application, we would have seen our initialization
parameter listed under the
Init parameters
section of the
Context
tab.
An alternate way of adding context parameters to our web application is
to use NetBeans'
web.xml
visual editor, in the
General
tab.
Recall that the servlet context is available from any servlet or JSP in our application.
In a servlet, it can be obtained by invoking the
getServletContext()
method,
which returns an instance of
javax.servlet.ServletContext
, and is defined in
the
javax.servlet.GenericServlet
class, which is a "grandparent" class of all
servlets in a web application. We can obtain the value of an initialization parameter
by invoking the
getInitParameter()
method on this instance of
ServletContext
.
This method takes the parameter name as a
String
, and returns the parameter value
as a
String
.
The
Client and Server
tab of the HTTP monitor displays information about the
server where the application is deployed and about the browser used to access
the application.