Reputation: 2298
When calling a managed bean in a servlet using
MyBean myBean = (MyBean) request.getSession().getAttribute("myBean");
if it's about trying to call a SessionScopped managed bean : will this know exactly which bean instance to call (the one associated to the current user who was responsible of making the call). will this process be safe in case where many users use the servlet in the same time ? I want also know if it is possible to use an entity bean on a servlet.
Upvotes: 1
Views: 3635
Reputation: 1109422
If both are deployed on the same server and context, then, yes, JSF definitely uses the very same HTTP session as the servlet. JSF as being a servlet based MVC framework just runs on top of the standard servlet API and stores managed beans as session attributes with the managed bean name as key.
Upvotes: 2