Perhaps you http session tracking is not working at all. Try also putting
something else in your session and see if you get it back.

-Chris.

> -----Original Message-----
> From: KY ky Lui [SMTP:[EMAIL PROTECTED]]
> Sent: Tuesday, April 04, 2000 5:30 PM
> To:   [EMAIL PROTECTED]
> Subject:      session tracking for session bean
>
> I want to save a stateful bean handle in Httpsession, but i am fail.
> Everytime it will create a new session bean. why?
> my codes are listed below.
> thanks in advance
> =========== code ==========
>
> HttpSession session = request.getSession(true);
>     if (session != null)
>     {
>       hnd = (Handle)session.getValue("handle");
>       if (hnd == null)
>       {
>         try
>         {
>           InitialContext ctx = new InitialContext();
>           Object objref = ctx.lookup("cart");
>           homeCart = (CartHome)PortableRemoteObject.narrow(objref,
> CartHome.class);
>           theCart = homeCart.create(request.getParameter("name"));
>         } catch (Exception NamingException)
>           {
>             NamingException.printStackTrace();
>           }
>       }
>       else
>         theCart = (Cart)hnd.getEJBObject();
>       session.putValue("handle", theCart.getHandle());
>     }
>
>
> Send FREE April Fool's Greetings to your friends!
> http://www.whowhere.lycos.com/redirects/American_Greetings.rdct
>
> ==========================================================================
> =
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
> body
> of the message "signoff EJB-INTEREST".  For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to