Java Reference
In-Depth Information
The init() Method
public void init()
throws ServletException
This parameterless implementation of the init() method is provided only for convenience. It
prevents a derived servlet from having to store the ServletConfig object. init() has no para-
meters and returns no value.
It throws this exception:
The log(java.lang.String message) Method
public void log(java.lang.String message)
This log() method takes the passed-in message and the name of the servlet and writes them to
a log file. The location of the log is server specific. log() returns no value and throws no
It has one parameter:
The log(java.lang.String message, java.lang.Throwable t)
public void log(java.lang.String message,
java.lang.Throwable t)
This log() method takes the passed-in message and Throwable object and logs the message
with a stack trace from the Throwable object. log() returns no value and throws no excep-
It has two parameters:
The service() Method
public void service(ServletRequest request,
ServletResponse response)
throws ServletException,
The service() method defines the servlet's entry point for servicing requests. It can be exe-
cuted only after the servlet's init() method has executed successfully. The service() method
is the life cycle method executed for every incoming request. It returns no value.
Search WWH ::

Custom Search