This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

attributeUpdated

 
Ankur Jain Kothari
Ranch Hand
Posts: 154
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ?
 
Ankur Jain Kothari
Ranch Hand
Posts: 154
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 234
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 154
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
by manually calling them
 
Brij Garg
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 154
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i know that....we shouldnt do that....leave it..understood what david was trying to say though
 
Harpreet Singh janda
Ranch Hand
Posts: 317
Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What did you understand?

Please post it so that we can also understand.
 
Ankur Jain Kothari
Ranch Hand
Posts: 154
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic