Results 1 to 3 of 3

Thread: Programmatic retrieval of beans via @Qualifier

  1. #1
    Join Date
    Feb 2006
    Posts
    17

    Default Programmatic retrieval of beans via @Qualifier

    Is there a way to programmatically retrieve a bean via a qualifier?

  2. #2

    Default

    You can use ApplicationContext.getBeansWithAnnotation() if you have several beans of the same type which differ in their qualifier annotations.
    Gabriel Axel
    Sparklix | Blog | Twitter | Github

  3. #3
    Join Date
    Feb 2006
    Posts
    17

    Default

    That's interesting, as is this thread: http://forum.springsource.org/showthread.php?t=78141.

    Still, I'm probably going to stick with my map of type->beanNames hack for now. It's probably more performant and less code.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •