servlet中绑定spring bean

public void init(ServletConfig config) throws ServletException {
     super.init(config);
     SpringBeanAutowiringSupport.processInjectionBasedOnServletContext(this, config.getServletContext());

}


@Autowired  
    private YourBean yourBean;

你可能感兴趣的:(spring,bean,servlet,Autowired)