public void init(ServletConfig servletConfig) throws ServletException {
      ServletContext servletContext = servletConfig.getServletContext();
      WebApplicationContext webApplicationContext = WebApplicationContextUtils.getWebApplicationContext(servletContext);
      YOUR_BEAN = (YOUR_BEAN) webApplicationContext.getBean("your_bean_name");
 }

相关文章:

  • 2022-12-23
  • 2021-05-24
  • 2021-07-26
  • 2022-02-04
  • 2021-12-27
  • 2022-12-23
  • 2021-04-17
  • 2022-12-23
猜你喜欢
  • 2021-10-19
  • 2021-11-30
  • 2022-12-23
  • 2021-08-23
  • 2021-11-20
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案