Class 2 |
Intermediate Java 30-IT-397 |
|
init()
-
init() is called only once, when the servlet is called for the first time,
or when the server is started.
-
init() can take a ServletConfig object as a parameter if server information
is needed.
-
ServletConfig has a method, getInitParameters(), that gets initialization
parameters from the server.
-
These properties can be found in web.xml.
-
If you use this, you must call super.init(ServletConfig) so that the server
can continue to use the configuration parameter.
-
If ServletConfig is not needed, it can simply be used without arguments.
service()

Created by: Brandan Jones
December 20, 2001