ServletConfig interface
public interface ServletConfig
Implementation classes: Genericservlet, HttpServlet
First, Introduction
A configuration object that is used by the servlet container to pass information to it during the servlet initialization.
Second, the method
1, ServletContext Getservletcontext ()
Returns a reference to a ServletContext (servlet context) object that the caller executes in this ServletContext.
This ServletContext object is used by the caller to interact with its servlet container.
2, String Getinitparameter (string name)
Gets the value of the initialization parameter for the given name, or null if the initialization parameter does not exist.
3, enumeration<string> Getinitparameternames ()
Returns the name of all initialization parameters of the servlet, returned as an enumerated object.
If no initialization parameters exist, an empty enumeration is returned.
4. String Getservletname ()
Returns the name of the servlet instance.
This name can be provided by server management, allocated in the Web application Deployment Descriptor (XML.), and for a servlet instance that is not registered (and therefore not named), the class name of the Servlet class (the first letter of the default lowercase class name) is returned. )。
ServletConfig interface in Java EE Javax.servlet