|
Handles... check out javax.ejb.Handle and
javax.ejb.HomeHandle.
to get
the handle of an instance i, you use i.getHandle(); this is defined in
javax.ejb.EJBObject. Section 6.5 of the spec refers to EJBObject in a Session
Bean.
Handles are serializable and network
transparent.
Basically, SFSB hold state, but you need to keep
track of the reference to the SFSB... that's what the handle is
for
example (in jsp):
page1.jsp:
<%
....
mySFSB
s = sHome.create();
s.setUsername("jpl");
session.setAttribute("CustomerSession", s.getHandle() )
;
...
%>
page2.jsp
<%
....
mySFSB
s = (SFSB) ((Handle)
session.getAttribute("CustomerSession")).getEJBObject();
String
username = s.getUsername();
....
%>
HTH,
Juan Pablo Lorandi
Chief Software
Architect
Code Foundry Ltd.
Barberstown, Straffan, Co. Kildare, Ireland. Tel: +353-1-6012050 Fax: +353-1-6012051 Mobile: +353-86-2157900 www.codefoundry.com Disclaimer:
Opinions expressed are entirely
personal and bear no relevance to opinions held by my employer.
Code Foundry Ltd.'s opinion is that I
should get back to work.
|
Title: Message
- Stateful session beans Michael Pikounis
- Re: Stateful session beans Benjamin Bonnet
- Re: Stateful session beans Tye, Tim
- Stateful Session Beans GlennODickson
- Re: Stateful Session Beans GlennODickson
- Re: Stateful Session Beans Dmitri Colebatch
- Re: Stateful Session Bean... GlennODickson
- Re: Stateful Session ... Dmitri Colebatch
- Re: Stateful Session Beans Juan Pablo Lorandi
- Re: Stateful Session Beans GlennODickson
- Re: Stateful Session Beans Juan Pablo Lorandi
- Re: Stateful Session Beans Ashwani Kalra
- Re: Stateful Session Bean... Dmitri Colebatch
- Re: Stateful Session ... Ashwani Kalra
- Re: Stateful Ses... Dmitri Colebatch
- Re: Stateful Session Beans Kesavanarayanan, Ramesh (Cognizant)
- Re: Stateful Session Beans GlennODickson
- Re: Stateful Session Beans Dmitri Colebatch
- Re: Stateful Session Bean... GlennODickson
