|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.servlet.GenericServlet
public abstract class GenericServlet
GenericServlet is a convenient abstract class for defining Servlets. Servlets which need more control than HttpServlet can extend GenericServlet.
In addition, GenericServlet implements ServletConfig to make it easier to get configuration information.
Servlet configuration looks like the following:
<servlet servlet-name='myservlet'
servlet-class='test.MyServlet'>
<init-param param1='value1'/>
<init-param param2='value2'/>
</servlet>
Constructor Summary | |
---|---|
GenericServlet()
|
Method Summary | |
---|---|
void |
destroy()
Called when the servlet (and the application) shuts down. |
java.lang.String |
getInitParameter(java.lang.String name)
Returns an initialization parameter. |
java.util.Enumeration<java.lang.String> |
getInitParameterNames()
Enumerates all the initialization parameter. |
ServletConfig |
getServletConfig()
Returns this servlet's configuration. |
ServletContext |
getServletContext()
Returns the application (servlet context) that the servlet belongs to. |
java.lang.String |
getServletInfo()
Returns a string describing the servlet. |
java.lang.String |
getServletName()
Returns the servlet name for this configuration. |
void |
init()
Initialize the servlet. |
void |
init(ServletConfig config)
Initialize the servlet. |
void |
log(java.lang.String message)
Logs an error message in the application's log. |
void |
log(java.lang.String message,
java.lang.Throwable cause)
Logs an error message and an exception trace in the application's log. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface javax.servlet.Servlet |
---|
service |
Constructor Detail |
---|
public GenericServlet()
Method Detail |
---|
public void init(ServletConfig config) throws ServletException
init()
instead.
init
in interface Servlet
config
- the servlet's configuration
ServletException
public void init() throws ServletException
ServletException
public ServletConfig getServletConfig()
getServletConfig
in interface Servlet
public java.lang.String getServletName()
<servlet servlet-name='myservlet'
servlet-class='test.MyServlet'/>
getServletName
in interface ServletConfig
public java.lang.String getInitParameter(java.lang.String name)
<servlet servlet-name='myservlet'
servlet-class='test.MyServlet'>
<init-param param1='value1'/>
<init-param param2='value2'/>
</servlet>
getInitParameter
in interface ServletConfig
name
- of the parameter
public java.util.Enumeration<java.lang.String> getInitParameterNames()
getInitParameterNames
in interface ServletConfig
public ServletContext getServletContext()
getServletContext
in interface ServletConfig
public java.lang.String getServletInfo()
getServletInfo
in interface Servlet
public void log(java.lang.String message)
public void log(java.lang.String message, java.lang.Throwable cause)
public void destroy()
destroy
in interface Servlet
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |