• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Is there a way to determine which HttpSession attribute value changed?

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

I'm looking to figure out if it's possible to do the following:



Obviously, you can use the HttpSessionAttributeListener to determine which attribute has changed. However, it doesn't return the new value but rather the old one.

You can use the HttpSessionEvent listener to determine when a session object has been changed.

Is there a way you can determine when a session object changes (and it does NOT occur when the setAttribute method is called...) and determine the updated key:value pair?
 
Greenhorn
Posts: 16
1
Netbeans IDE Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Minja,

Once you get the attributeReplaced() callback invoked can't you just use getAttribute(name key of attribute in question) on the HttpSession in question to get the new value? Am I missing something?

Thanks,
Asif
 
Minja Gaso
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Asif Pathan wrote:Hi Minja,

Once you get the attributeReplaced() callback invoked can't you just use getAttribute(name key of attribute in question) on the HttpSession in question to get the new value? Am I missing something?

Thanks,
Asif



Hi Asif,

The issue is that the class(es) that would implement the attribute listener interface are not hand-coded, but generated through XSD schemas with JAXB. [not sure I should ask it in this sub-board, but...] Can these schemas be made aware of the interface (I'm sure they can) AND capable of overriding the methods? Our web application bean classes are frequently upgraded with new fields/methods upon user requests, so it's far easier to just run a JAXB automated process than hand code, obviously.

Thanks,
Minja
 
Asif Pathan
Greenhorn
Posts: 16
1
Netbeans IDE Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am not sure how to do that with JAXB, but probably this question should be rephrased and posted in a more related forum so it gets attention of guys with experience in that area. I'll look up if I can find something.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic