Win a copy of AWS Security this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

attributeUpdated

 
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
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • 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?
 
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
 
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
 
Hang a left on main. Then read this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic