- 博客(3)
- 收藏
- 关注
原创 工具类中注入service及静态方法中调用非静态方法
一:静态方法中调用非静态方法在静态方法a中调用静态方法b,b的参数为该类的对象,如static void sendSmsJfForStatic(ChuangLanSendSmsUtil chuangLanSendSmsUtil){ chuangLanSendSmsUtil.sendSmsJf();}再在静态方法b中调用非静态方法。注意:此处做了处理,直接将...
2019-04-17 10:00:15 590
原创 JAXWS 开发webService ,使用spring注入service类时,无法注入,报空指针
解决方法:实现类需要extends SpringBeanAutowiringSupport ,举例如下:public class SyncUsersImpl extends SpringBeanAutowiringSupport implements ISyncUsers{@Autowired(required=true)private CsrService csrServ...
2019-04-10 18:27:37 374 2
原创 工具类注入Service(静态和非静态)
工具类使用注解注入Service静态工具类注入1、在spring自动扫描包设置中将工具类所在的包加进来代码:@Componentpublic class TestUtil { @Resource private TEStationService stationService; private static TestUtil testUtil; ...
2019-04-10 09:37:36 600
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人