Hi.
I have noticed strange behavior when storing objects in the HttpSession.
The code fragment below (from a servlet) sometimes prints out:

This should never happen: class knut.servlet.SessionInfo

How is this possible?

/Regards
Mattias Arbin

HttpSession session = req.getSession(true);
...
knut.servlet.SessionInfo info = null;
Object o = session.getAttribute("sessionInfo");
if (o!=null && (o instanceof knut.servlet.SessionInfo))  {
    info = (knut.servlet.SessionInfo)o;
    System.err.println("Got sessionInfo: "+info.getUserId());
}
else  {
    System.err.println("No sessionInfo");
    if (o!=null)   {
        // This should never happen, but it obviously does. Is this a bug in
Orion?
        System.err.println("This should never happen :
"+o.getClass().toString());
    }
}



Reply via email to