Hi,
I'm a bit confused about what to keep on the web tier to have a handle on the statefull session bean (SFSB) "Client Controller". I use Sun's Petstore 1.1.2 app as a tutorial, and what I see is that the reference kept in the HTTPSession is the EJB's remote reference (simply the return of the create() method).
I applied the same architecture in my app : I use a SFSB as a client controller to maintain state. However, I noticed that the SessionContext principal isn't maintained between HTTP requests (it is lost on the second request, the first one after creating the SFSB). My servlet is unauthenticated, all authentication is done on the SFSB. It seems that web unauthentication is transmitted to the EJB tier. Am I right ? I'm using WL 5.1 .
Thanks
Originally posted by Nitin Shivaram:
Hi Bill,
Holding a reference to the stateful bean would not be the done by the browser but by a server side application which runs in a browser, typically a servlet or a jsp.
This is how you could do it.
The reference to the stateful session bean has to be converted to an javax.ejb.Handle, to make sure you abstract the non-bean characteristics, and then store this handle in a session.
And then when you have to use it, retrieve from the session, call getEJBObject() to get the reference to the stateful bean.