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".