6 interface functions of the Servlet3.0

Source: Internet
Author: User

SERVLET3.0 has (but is not limited to) the following interfaces:

1, Servletcontextlistener

This interface is used to listen for startup and shutdown events for Web application.

2, Servletcontextattributelistener

This interface is used to listen for property (attribute) change events on ServletContext objects. This is the property Change event on application.

3, Servletrequestlistener

This interface is used to listen for client initiated requests (request) events.

4, Servletrequestattributelistener

This interface is used to listen for property (attribute) change events on ServletRequest objects.

5, Httpsessionlistener

This interface is used to listen for the start and end events of the session with the client.

6, Httpsessionattributelistener

This interface is used to listen for property (attribute) Change events on the Session object.


To say more, @WebListener this annotation is a feature of the Servlet3.0, this annotation is equivalent to the previous configuration in the Web. xml file:

<listener> <listener-class>com.abc.servlet3.ServletContextEventHandler</listener-class> </ Listener>

The Com.abc.servlet3.ServletContextEventHandler in the above configuration is my fiction, in short, your implementation of the Xxxxxxlistener class. By writing @weblistener annotation on your implementation class, you can omit the configuration of listener information in Web. Xml.

This article is from the "Bitterjava" blog, make sure to keep this source http://rickqin.blog.51cto.com/1096449/1697499

6 interface functions of the Servlet3.0

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.