Can you use @Autowired with static fields?

后端 未结 11 1360
臣服心动
臣服心动 2020-11-22 13:15

Is there some way to use @Autowired with static fields. If not, are there some other ways to do this?

11条回答
  •  名媛妹妹
    2020-11-22 13:39

    In short, no. You cannot autowire or manually wire static fields in Spring. You'll have to write your own logic to do this.

提交回复
热议问题