Configuring Listener in web.xml

Configuring Listener in web.xml


Posted in : Servlet Posted on : December 3, 2010 at 6:22 PM Comments : [ 0 ]

This section contains the details about Configuring Listener in web.xml

Configuring Listener in web.xml

Since Listeners are basically servlet , they need to configure in web.xml or deployment descriptor. So that server can invoke it when needed.

Given below the syntax for configuring it into servlet :

<listener>
<listener-class>Listener-name1</listener-class>
<listener-class>Listener-name2</listener-class>
.
.
</listener>

The 'Listener-name' is the full qualified name of the listener class (with package name etc).

Example

<listener>
<listener-class>dev.myContextListenerClass</listener-class>
<listener-class>dev.mySessionAttributeListenerClass</listener-class>
</listener>
Go to Topic «PreviousHomeNext»

Your Comment:


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 

 
Tutorial Topics