Originally posted by agrah upadhyay:
One more thing: while executing sessionCreted() method of HttpSeesionListener class ,if any attribute is added to the session,it should call attributeAdded() method in HttpSessionAttributeListener.But if method sessionCreated() is not completed yet,will Container first transfer the control to attributeAdded() and will come to sessionCreated() later?
There is no way that the control will be changed from sessionCreated to attributeAdded. There either two possibilities I think :
1. The container creates a new
thread for each listener, so the HttpSessionListener and HttpSessionAttributeListener can both be called at the same time
2. The container does not create new threads, and in this case, you'll have to wait until sessionCreated ends.
Sry, I don't know which one it is.
You should not have heavy process in your listeners anyway, so sessionCreated SHOULD be finished before attributeAdded is called