2 Replies Latest reply on Oct 31, 2005 7:48 AM by uml20

    Entity Bean injection doesn't work while

    uml20


      after I removed the login interceptor in hotel booking sample application, the
      "user" entity bean couldn't be injected by seam , but in loginAction.login() {} i can find the "user" entity bean instance.
      Does it the right lifecycle semantic ?

        • 1. Re: Entity Bean injection doesn't work while
          drapierwim

          The user is loaded form the DB, if a user is found with the right name and
          password it gets outjected by seam in the sessioncontext. (see below)

          user = results.get(0);
          sessionContext.set("loggedIn", true);
          


          This entity bean is session scoped with the @Scope annotation.
          My advice is you should read the documentation things are very well explained. I still read it almost every day.

          Cheers

          • 2. Re: Entity Bean injection doesn't work while
            uml20

            Thanks for your response first.

            I think that you misunderstood my question. @-@

            1.without loginInterceptor, in "login".login(){}, I can find the "user" bean by sessionConext.get("user") before querying database, and the annotated "@In private User user" is not null. (auto injected)

            2.with loginInterceptor, in "login".login(){}, I can find the "user" bean by sessionConext.get("user") before querying database, but the annotated "@In private User user" is null. (not injected)

            so interceptors are responsible for link objects in contexts to fields of session_bean/java_bean.
            [img]http://bbs.wayup.hexun.com/img/002_t.gif[/img]
            [img]http://bbs.wayup.hexun.com/img/0015_t.gif[/img][/img]