修改servlet 的 init 方法,添加以下代码:

SpringBeanAutowiringSupport.processInjectionBasedOnServletContext(this,  
	              config.getServletContext());  

  

就可在servlet中使用注入了:

@Autowired
	private MapApiconfigServiceI mapApiconfigService;

  

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-28
  • 2021-08-06
  • 2021-06-18
  • 2021-08-23
  • 2021-11-20
猜你喜欢
  • 2021-07-26
  • 2022-12-23
  • 2021-10-19
  • 2021-11-06
  • 2021-11-30
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案