• Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
Minja Gaso
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • 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?
 
Asif Pathan
Greenhorn
Posts: 16
1
Eclipse IDE Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • 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
  • 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
Eclipse IDE Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!