Hi all, This one is interesting i am trying a simple chat application in struts just go through the following code: I want to catch the event when any new user logs in, i add every user id in to vector list. i update the orignal vector with new element. As you should be knowing ServletContextAttributeListener has attributeReplaced method which i think should get called but it's not getting called same thing when i tries with a single String object it is working fine(but not with vector value updated and that means rest of the code is fine i also added listner tag in web.xml properly dont worry about it.) following is the code for it with class
Have you run your modified code and are still getting the same behaviour ?
If yes, tell us the servlet container you are using.
Joined: Apr 15, 2006
yes, please read my problem bit carefully what i am emphasizing on is i. i am not changing the actual object see it is same but the value of the object is changed. is that why that function addedAttributeListener not getting called...?
Therefore the behaviour seems to be container specific . It might be comparing the old value object reference with the new value object reference . since they are same , it might not be generating the event.
If you are going to post more than a line or two of your code, wrap that code in a set of UBB Code tags. Doing so will help to preserve your code's indenting, making it easier to read. If it is easier to read, more people will actaully read it and you will stand a better chance of getting help with your question. See UseCodeTags for more help with UBB code tags.
Sorry i did not get what do you mean? But i will write the further code in attributeReplaced method when new user Logs-in to chat room. for that the function must get invoked but it is not, and that is the problem? Please be more elaborative on questions?
Thanks Manoj Amrutkar
Joined: Apr 15, 2006
Another geniune problem i am facing is, if i press f5 i mean refresh a page in the list of chatters one more time same userid gets added. So problem is how to distinguish between new users action and refresh page action.