ServletConfig interface in Java EE Javax.servlet

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.