Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想从容器中检索所有 CDI bean 作为映射,其中 bean 名称作为键,bean 作为值。我怎么能做到这一点?
我需要这个来将 CDI bean 添加到 thymeleaf 表达式解析器。
为事件编写一个可移植的扩展程序和 this ProcessAnnotatedType。然后让它查找具有@Named注释的类型并将其添加到您的类或其他类的静态映射中。
ProcessAnnotatedType
@Named