tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fumitada <fumihatt...@earthlink.net>
Subject Re: one session per user?
Date Thu, 15 Feb 2001 11:22:31 GMT
Hi there,

First, Do u know how to code Java ? (No offence)
I give u some tips...
>HttpSession session = req.getSession(false);
>    Toto toto = session.getAttribute("toto");
     U didn't cast up there.
     // should be Toto toto = (Toto) session.getAttribute("toto");
>    if (toto.getName() == "mike")
     == is for C language if you wanna know whether both letters are
same.

     // should be toto.getName().equals("mike");
>        toto.setInfotoDisplay("Hi mike, waza?");
>    else if (toto.getName() == "alain")
     Here too. 
>        toto.setInfotoDisplay("Tcho alain, ca boom?");
>    ...
>    session.setAttribute("toto", toto);

Maybe your problem is not session, but your coding.
Probably you gotta learn syntax first...(No offence)

Fumitada

Mime
View raw message