Servlet中调用 Spring管理的 Service层方法(SSH框架中)

ServletContext servletContext = this.getServletContext();  

WebApplicationContext wac = null;   
wac = WebApplicationContextUtils.getRequiredWebApplicationContext(servletContext);  
	    
this.userService = (UserService) wac.getBean("userService");//Spring配置中的UserService对应的id  


你可能感兴趣的:(Servlet,servlet,spring,service,框架,null,ssh)