why to write <listener-class> in web.xml ? I see that container would understand that the class is a listner class by seeing that that class has implemented listener interface. Then, if it doesn't make any difference to specify <listener-class> ?
The container doesn't check every class in your application if it is a listener class or not. Only listeners declared in the web.xml are registered for listening to events by the container...
why to write <listener-class> in web.xml ? I see that container would understand that the class is a listener class by seeing that that class has implemented listener interface. Then, if it doesn't make any difference to specify <listener-class> ?
I think it makes sense in telling the container that these are the listener class because imagine a situation where in a application has hundreds of class and container has to go through each and every class to find out if they are listener implementer or not !!
SCJP 6
Why to worry about things in which we dont have control, Why to worry about things in which we have control ! !
Creativity is allowing yourself to make mistakes; art is knowing which ones to keep. Keep this tiny ad:
a bit of art, as a gift, the permaculture playing cards