I have recently learnt about stateful and stateless session beans in ejb. I can work along with stateless session beans without any problem (created several applications) but i am finding it hard to implement an application with a stateful session bean.
Here is my scenario : A customer can login using an id and do transactions in his/her account. I want to save the id in to a session bean at the login servlet itself , so that i can retrieve the id from the session to perform transactions.
I know how to work with httpSessions but not with these ejb sessions (stateful beans). Please guide , i want to save the account id to the session (ejb stateful session) and retrieve it back in another servlet.
I have used httpSessions , below is my code:
HttpSession session=request.getSession();
session.setAttribute("accountID", accountid);
But the above is the normal session, how do i use the account session bean to save the id and retrieve it.
Thank you