标签:
今天做项目,需要给一个类中的静态变量使用@Resource,然后注入时候,程序报错了 @Resource annotation is not supported on static fields,原来spring annotation不支持静态变量注入,因此上网搜了一下,找到了解决的办法,就是把get,set方法的static 修饰符去掉,然后在set方法上面加@Resource即可,问题解决问题解决: @Resource annotation is not supported on static fields
标签:
原文地址:http://blog.csdn.net/wang_huanming/article/details/46545825