java.lang.Objectjavax.servlet.GenericServlet
All Implemented Interfaces:
ServletConfig, Servlet, Serializable
Direct Known Subclasses:
HttpServlet
GenericServlet implements the Servlet
and ServletConfig interfaces. GenericServlet
may be directly extended by a servlet, although it's more common to extend
a protocol-specific subclass such as HttpServlet.
GenericServlet makes writing servlets
easier. It provides simple versions of the lifecycle methods
init and destroy and of the methods
in the ServletConfig interface. GenericServlet
also implements the log method, declared in the
ServletContext interface.
To write a generic servlet, you need only
override the abstract service method.
Various - $ - Version$| Constructor: |
|---|
init methods. |
| Method from javax.servlet.GenericServlet Summary: |
|---|
| destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log, service |
| Methods from java.lang.Object: |
|---|
| equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method from javax.servlet.GenericServlet Detail: |
|---|
|
String containing the value of the named
initialization parameter, or null if the parameter does
not exist. See ServletConfig#getInitParameter .
This method is supplied for convenience. It gets the
value of the named parameter from the servlet's
|
Enumeration of String objects,
or an empty Enumeration if the servlet has no
initialization parameters. See ServletConfig#getInitParameterNames .
This method is supplied for convenience. It gets the
parameter names from the servlet's |
|
This method is supplied for convenience. It gets the
context from the servlet's |
|
|
super.init(config).
Instead of overriding #init(ServletConfig) , simply override
this method and it will be called by
|
This implementation stores the ServletConfig
object it receives from the servlet container for later use.
When overriding this form of the method, call
|
|
Throwable exception
to the servlet log file, prepended by the servlet's name.
See ServletContext#log(String, Throwable) . |
This method is declared abstract so subclasses, such as
|