I got the solution but there is a strange behaviour or i m not sure how it should behave . like
i have followed this link
and tried its happening but when i stop application server.
But ideally it should happen where ever we are storing data into seesion it should persist , i m not sure, i might be wrong.
and another strange thing is when i tried with a ear its not persisting.
Can anybody give any idea how to resolve this.