随笔-9  评论-168  文章-266  trackbacks-0

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 紫蝶∏飛揚↗ 阅读(1308) 评论(0)  编辑  收藏 所属分类: Spring重点

只有注册用户登录后才能发表评论。


网站导航: