aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes attributeUpdated 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 "attributeUpdated" Watch "attributeUpdated" New topic
Author

attributeUpdated

Ankur Jain Kothari
Ranch Hand

Joined: Feb 08, 2010
Posts: 154
Can we create a new method attributeUpdated in a class that implements ServletRequestAtttributeListener and then use ServletRequestAttributeEvent.getValue() to get the old value of the attribute that was replaced?

i was wondering how will the method get hold of the Event...this was just an option from one of the Davids book. People say it has many errors...so i have to check if his answers are correct.....this is actually a good thing...helping me to learn things


Do What You Wanna Be....Taking Things The Way They Come
scjp 1.6 91 percent, scmad 90 percent(rounded off to nearest integer)
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

Can we create a new method attributeUpdated in a class that implements ServletRequestAtttributeListener

Who is going to call it ? Isn't what attributeReplaced is used for ?


[My Blog]
All roads lead to JavaRanch
Ankur Jain Kothari
Ranch Hand

Joined: Feb 08, 2010
Posts: 154
what if we call it when we update an attribute.....i know attributeReplaced is used for it but can we create another method say attributeFind()....can we create our own listener?
Brij Garg
Ranch Hand

Joined: Apr 29, 2008
Posts: 234

what if we call it when we update an attribute.....i know attributeReplaced is used for it but can we create another method say attributeFind()....can we create our own listener?


But how will you call it?
I am also prepring for SCWCD. Dont have much idea about Listener. But my point is even if we can create our own listeners then how will methods in that listener get invoked? How we will maap the event and the its corresponding method in listener class?

Ankur Jain Kothari
Ranch Hand

Joined: Feb 08, 2010
Posts: 154
by manually calling them
Brij Garg
Ranch Hand

Joined: Apr 29, 2008
Posts: 234
by manually calling them


Dont you think, then it will defeat the purpose of Listeners. We can have that method in any other java class and then call it.

I think we dont call listeners methods manually.
Ankur Jain Kothari
Ranch Hand

Joined: Feb 08, 2010
Posts: 154
i know that....we shouldnt do that....leave it..understood what david was trying to say though
Harpreet Singh janda
Ranch Hand

Joined: Jan 14, 2010
Posts: 317

What did you understand?

Please post it so that we can also understand.
Ankur Jain Kothari
Ranch Hand

Joined: Feb 08, 2010
Posts: 154
even if we do happen to create the method the container wont ever call it...so there is no way to retrieve any value to the attribute
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: attributeUpdated