jsp文件:
<%@ page import="javax.servlet.ServletContext" %>
<%@ page import="org.springframework.context.ApplicationContext" %>
<%@ page import="org.springframework.web.context.support.WebApplicationContextUtils" %>
<%
//獲取ApplicationContext對象
ServletContext servletContext = request.getSession().getServletContext();
ApplicationContext ac = WebApplicationContextUtils.getWebApplicationContext(servletContext);
//獲取ApplicationContext.xml文件中定義的BEAN
PictureService ps=(PictureService)ac.getBean("pictureService");
posted on 2008-08-19 13:26
紫蝶∏飛揚↗ 閱讀(1327)
評論(0) 編輯 收藏 所屬分類:
Spring 、
重點