Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

How to get Stateful bean from SessionFacade

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ... ?

 
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you can use DI to inject the SFSB.
 
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your answers guys!
 
sivan jai
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 :-)
 
Did you ever grow anything in the garden of your mind? - Fred Rogers. Tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic