4 Replies Latest reply on Nov 25, 2009 1:27 AM by asookazian

    Current annotation

    gonorrhea

      According to ref doc, @Current is the default binding type:



      If a Web Bean does not explicitly specify a set of binding types, it has exactly one binding type:
      the default binding type @Current.

      This annotation is used for DI in Web Beans.


      For example:


      @SessionScoped @Named
      public class Login {
      @Current Credentials credentials;
      ...
      }



      What is the difference between @Current and Seam's @In?  I know that with @In, if you don't specify a particular context/scope to search in for that context variable, then it searches all of them in a certain order.


      Does @Current do this as well or is it limited to the current scope and that's the reason for the name change of the injector annotation (i.e. from @In to @Current)?