I'm troubleshooted with this starnge behaviour of the session. I have implemented SessionAware and have defined a session attribute of Map type with getter (and setter) as indicated to handle session.
I'm putting a User objet to the session and want to retrieve it after some steps. The code below gives me an Object that is already well typed. Object user=getSession().get(Constantes.USER_SESSION_KEY); I'm seeing the object but when I try to Cast it, like that user=(User)user; I'm getting a ClasscastException. What am I missing here ? why can't we cast objects from the session. Meissa L'integrite de ce message n'etant pas assuree sur internet, Natixis ne peut etre tenu responsable de son contenu. Toute utilisation ou diffusion non autorisee est interdite. Si vous n'etes pas destinataire de ce message, merci de le detruire et d'avertir l'expediteur. Ensemble, faisons un geste pour l'environnement : n'imprimons nos mails que si necessaire The integrity of this message cannot be guaranteed on the Internet. Natixis can not therefore be considered responsible for the contents. Any unauthorized use or dissemination is prohibited. If you are not the intended recipient of this message, then please delete it and notify the sender. Let us mind the environment : let's print our mails only when necessary.