This is more of a Java servlet question than EJB...

HttpSession session = httpServletRequest.getSession ( true );

session.putValue ( "ClientSessionState", state );

State state = (State) session.getValue ( "ClientSessionState" );

Parikshit Pol wrote:

> 
>_____________________________________________________________________________________________________________
> Parikshit Pol
>
> >
> > Dear All,
> > I'm Writing an Application in which a Servlet is used to Access a Stateful Session 
>Bean , which in turn accesses multiple Entity beans.The Stateful Session Bean manages 
>the workflow and maintains the Client State .
> >
> > Here in this Application we are supposed to add items to a shopping cart .
> >
> > But as a Servlet State is not maintained across across multiple requests from a 
>Client  , what is the use of Stateful Session Bean?
> > I can maintain the Client Session state in a Servlet by a Cookie , and the 
>shopping Cart contents in a temporary Database on the Server associated with the 
>Client Session state.
> >
> > But then the Stateful Session Bean has no use here . Because each time the Servlet 
>has to create a new instance of the session bean, as each time a new Instance of the 
>Servlet will be invoked for each request from the Client.So am I Better off using 
>stateless Session Bean instead of Stateful Session Bean.Or is there any other 
>alternative to this solution or am I wrong somewhere.
> >
> > Thanks for Reading,
> > Parikshit
>
> Hi Shelly,
>
> You can store the remote reference to the stateful session bean in the
> HttpSession and then look it up everytime. Then you wont be recreating
> it everytime.
>
> regards,
> inder
>
> [Parikshit Pol]
> Hi InderJeet,
> Thank you , but could you please elaborate on that.
> Parikshit
>
> >
> > ===========================================================================
> > 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".
>
> ===========================================================================
> 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