File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Regarding Listeners Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Regarding Listeners" Watch "Regarding Listeners" New topic

Regarding Listeners

Nagamalini Pampati

Joined: Oct 04, 2006
Posts: 20
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,
Nilesh Raje
Ranch Hand

Joined: Aug 02, 2005
Posts: 153

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??

Thanks and Regards,<br />Nilesh<br />SCJP 1.4, SCWCD 1.4
Nagamalini Pampati

Joined: Oct 04, 2006
Posts: 20
i mean when the attribute is replaced what methods are called?
arrributeRemoved() and valueUnbound() are called or only valueUnbound() is called?
Nagamalini Pampati

Joined: Oct 04, 2006
Posts: 20
sorry Nilesh.....
i want to ask...when the attribute is replaced which methods are called?
either attributeAdded() or attributedAdded() and attributeRemoved()?
Christophe Verré

Joined: Nov 24, 2005
Posts: 14688

If you're talking about ServletContextAttributeListener, attributeReplaced will be called.

[My Blog]
All roads lead to JavaRanch
I agree. Here's the link:
subject: Regarding Listeners
It's not a secret anymore!