5 Replies Latest reply on Jun 19, 2006 2:38 PM by gavin.king

    HttpSession, Seam SessionContext and bijection

    sunfire

      Hi there,

      I have a little issue with the understanding of how the HttpSession of a webcontainer and the seam SessionContext interact.
      My Problem is that I set a HttpSession variable in a Filter with

      session.setAttribute("loggedInUser", user);
      

      this works finde since I can access the object from jsf with something like
      #{loggedInUser.login}
      

      Now I wanted to inject the variable into a seam component like this
      @In(value="loggedInUser", scope=ScopeType.SESSION)
      private User currentUser;
      

      and it did not work but told me all the time that I needed a value for it.
      Out of curiosity I changed it to this
      @In(value="#{loggedInUser}", scope=ScopeType.SESSION)
      private User currentUser;
      

      and it worked.
      Now I want to replace the object with a different one in the component and outject it back into the session context. and so I changed it again to
      @In(value="#{loggedInUser}", scope=ScopeType.SESSION)
      @Out(value="loggedInUser", scope=ScopeType.SESSION)
      private User currentUser;
      

      and now seam yells at me (for good reason I guess ;)) that a "Seam component hides managed bean with same name".
      So since I obviously do something very wrong can you please tell me what the proper way would be to @In/@Out-ject something into the HttpSession context?

      Thanks, Thorsten