0 Replies Latest reply on Aug 3, 2013 4:37 PM by Mrinal Thigale

    Injection of session bean in request scoped managed bean is null

    Mrinal Thigale Newbie

      I have the following flow in my app.

       

      Load main page --->

      AuthenticatorAction is loaded which validates user

       

      This has scope :

      @Stateless

      @Name("authenticator")

       

      Now i have injected a session bean

      @In(required=false)  

          @Out(required=false, scope = SESSION)

          private MyXMPPManager xmppm;

       

      I call a few methods after successful authentication

       

      Now I navigate to another page main.xhtml

      I want to display members from MyXMPPManager here

       

      Hnce I have added

      <h:dataTable value="#{MyXMPPManager.onlinefrnds}" var="XMPPFriend">

      <h:column>

          <f:facet name="header">Presence</f:facet>

          #{XMPPFriend.presence}

        </h:column>

        <h:column>

          <f:facet name="header">Name</f:facet>

          #{XMPPFriend.name}

        </h:column>

        <h:column>

          <a href="edit.faces?tid=#{XMPPFriend.name}">Challenge</a>

        </h:column>

      </h:dataTable>

       

      However when I run the project - the page doesnt display any of the data although the session bean instance is present

       

       

      Approach 2 : I added a request scoped  managed bean XMPPFriendList which injects MyXMPPManager ,and  added an entry in faces-config.xml for this request scoped XMPPFriendList Here in non parameteres constructor , I set member variable data to that in MyXMPPManager.

      Updated xhtml

       

      However the injected bean ref of MyXMPPManager is null here.

       

      Please help!