2 Replies Latest reply on Feb 25, 2011 4:39 AM by Stian Thorgersen

    Inject custom resource with @Resource

    Stian Thorgersen Novice

      Is it possible to inject a custom resource with @Resource? I'd like to be able to do:

       

      {code}

      @Resource

      private MyResource myResource

      {code}

       

      I would also like there to be multiple configurable versions of MyResource injected. For example:

       

      {code}

      @Resource(name="MyResource")

      private MyResource myResource

       

      @Resource(name="MyResource2")

      private MyResource myResource2

      {code}