Methods Summary |
---|
public void | destroy()Called by the servlet container to indicate to a servlet that the
servlet is being taken out of service. See {@link Servlet#destroy}.
|
public java.lang.String | getInitParameter(java.lang.String name)Returns a String containing the value of the named
initialization parameter, or null if the parameter does
not exist. See {@link ServletConfig#getInitParameter}.
This method is supplied for convenience. It gets the
value of the named parameter from the servlet's
ServletConfig object.
return getServletConfig().getInitParameter(name);
|
public java.util.Enumeration | getInitParameterNames()Returns the names of the servlet's initialization parameters
as an Enumeration of String objects,
or an empty Enumeration if the servlet has no
initialization parameters. See {@link
ServletConfig#getInitParameterNames}.
This method is supplied for convenience. It gets the
parameter names from the servlet's ServletConfig object.
return getServletConfig().getInitParameterNames();
|
public javax.servlet.ServletConfig | getServletConfig()Returns this servlet's {@link ServletConfig} object.
return config;
|
public javax.servlet.ServletContext | getServletContext()Returns a reference to the {@link ServletContext} in which this servlet
is running. See {@link ServletConfig#getServletContext}.
This method is supplied for convenience. It gets the
context from the servlet's ServletConfig object.
return getServletConfig().getServletContext();
|
public java.lang.String | getServletInfo()Returns information about the servlet, such as
author, version, and copyright.
By default, this method returns an empty string. Override this method
to have it return a meaningful value. See {@link
Servlet#getServletInfo}.
return "";
|
public java.lang.String | getServletName()Returns the name of this servlet instance.
See {@link ServletConfig#getServletName}.
return config.getServletName();
|
public void | init(javax.servlet.ServletConfig config)Called by the servlet container to indicate to a servlet that the
servlet is being placed into service. See {@link Servlet#init}.
This implementation stores the {@link ServletConfig}
object it receives from the servlet container for later use.
When overriding this form of the method, call
super.init(config) .
this.config = config;
this.init();
|
public void | init()A convenience method which can be overridden so that there's no need
to call super.init(config) .
Instead of overriding {@link #init(ServletConfig)}, simply override
this method and it will be called by
GenericServlet.init(ServletConfig config) .
The ServletConfig object can still be retrieved via {@link
#getServletConfig}.
|
public void | log(java.lang.String msg)Writes the specified message to a servlet log file, prepended by the
servlet's name. See {@link ServletContext#log(String)}.
getServletContext().log(getServletName() + ": "+ msg);
|
public void | log(java.lang.String message, java.lang.Throwable t)Writes an explanatory message and a stack trace
for a given Throwable exception
to the servlet log file, prepended by the servlet's name.
See {@link ServletContext#log(String, Throwable)}.
getServletContext().log(getServletName() + ": " + message, t);
|
public abstract void | service(javax.servlet.ServletRequest req, javax.servlet.ServletResponse res)Called by the servlet container to allow the servlet to respond to
a request. See {@link Servlet#service}.
This method is declared abstract so subclasses, such as
HttpServlet , must override it.
|