您现在的位置是:网站首页> 编程资料编程资料
JSP 获取Spring 注入对象示例_JSP编程_
                     2023-05-25
                265人已围观
                
                2023-05-25
                265人已围观
            
简介 JSP 获取Spring 注入对象示例_JSP编程_
<%@ page import="org.springframework.web.context.support.WebApplicationContextUtils"%><%@ page import="org.springframework.context.ApplicationContext"%> ServletContext sc = this.getServletConfig().getServletContext(); ApplicationContext ac2 = WebApplicationContextUtils.getWebApplicationContext(sc);
要获取的对象 serv = (要获取的对象) ac2.getBean("spring配置文件中的id");
您可能感兴趣的文章:
                
                
 
                                
                                                         
                                
                                                         
                                
                                                         
 
    