Java Reference
In-Depth Information
We can also add initialization parameters for our servlets. These parameters can be
read by our servlet by invoking the getInitParameter() method defined in the
javax.servlet.GenericServlet class. All servlets in a web application extend
javax.servlet.http.HttpServlet , which in turn extends javax.servlet.
GenericServlet , therefore this method is available to all of our servlets via
inheritance. This method takes the initialization parameter as a String object and
returns its value as a String . In our particular servlet we don't need initialization
parameters, therefore we don't need to enter any in the NetBeans servlet wizard.
Clicking the Finish button creates our servlet, plus adds the appropriate entries to
our web application's web.xml deployment descriptor.
Every Java web application must contain a configuration file called
web.xml . This file has information needed when the application is
deployed, therefore it is called a deployment descriptor. If we use
NetBeans wizards to create our servlets and JSPs this file is created
behind the scenes by NetBeans.
 
Search WWH ::




Custom Search