• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to get Stateful bean from SessionFacade

 
Vitaliy Kim
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

If anyone could help me with this sequence:

Controller -> SessionFacade -> SFSB by Dependency injection or after SessionFacade I need to use ServiceLocator and then SFSB ... ?

 
sivan jai
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can use DI to inject the SFSB.
 
Dmitri Ericsson
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is not right to use from Stateless Bean Stateful Bean, in this case state saving does not make sense
 
Vitaliy Kim
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dmitri Ericsson wrote:It is not right to use from Stateless Bean Stateful Bean, in this case state saving does not make sense


Ok, SessionFacade can be Stateful or Stateless, as I understand it's possible to use Stateful -> stateful, but not Stateless -> stateful by DI.

So here is another question, how can I get a link to SessionFacade (SFSB) from my Controller? Controller is not EJB bean... Is it only way through ServiceLocator?
 
Vitaliy Kim
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your answers guys!
 
sivan jai
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can have DI in servlets.
EDIT: reading your problem again I'm confused - SFSB is tied to a client so I don't think it is ok to inject it into a servlet. I think my answer is I dont know
I have been using Java for 8 years and I have used SFSB only once so I think I better stay away from this question :-)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic