Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Regarding Listeners

 
Nagamalini Pampati
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For contextListeners......setAttribute()....... If the name specified is already used for an attribute, this method will REPLACE the attribute with the new value to the new attribute.
so at this time will both attributeAdded() and attributeRemoved() will be called?or only attributeAdded() will be called?
Pls explain me...
Thanks in advance,
Malini.
 
Nilesh Raje
Ranch Hand
Posts: 153
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Malini,

I dint get your second part of question at this time..!?
The first Part is rite. wanted to know what you mean by at this time??
 
Nagamalini Pampati
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i mean when the attribute is replaced what methods are called?
arrributeRemoved() and valueUnbound() are called or only valueUnbound() is called?
Thanks,
Malini.
 
Nagamalini Pampati
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry Nilesh.....
i want to ask...when the attribute is replaced which methods are called?
either attributeAdded() or attributedAdded() and attributeRemoved()?
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you're talking about ServletContextAttributeListener, attributeReplaced will be called.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic