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.
有没有我可以使用的注释来代替实现 BeanNameAware?
如果它是一个单例,您可以使用以下内容:
@Service(value=MyService.myname) public class MyService{ public static final String myname = "myservicename"; }
否则,我认为您将不得不使用 BeanNameAware。