Saturday 6 September 2014

ServletContextAttributeListener

ServletContextAttributeListener receives notifications about ServletContext attribute changes.

There are 3 ways to add ServletContextListener to the Application.
1.Using Deployment Descriptor
2.Using WebListener Annotation
3.Using addListener method of ServletContext.

public interface ServletContextAttributeListener extends EventListener {
 public void attributeAdded(ServletContextAttributeEvent event);
 public void attributeRemoved(ServletContextAttributeEvent event);
 public void attributeReplaced(ServletContextAttributeEvent arg0);
}

ServletContextAttributeListener gets notification, whenever an attribute has been added, removed and replaced from the ServletContext.





Prevoius                                                 Next                                                 Home

No comments:

Post a Comment