Skip to content

Instantly share code, notes, and snippets.

@zzzfree
Created March 1, 2013 00:00
Show Gist options
  • Save zzzfree/5061241 to your computer and use it in GitHub Desktop.
Save zzzfree/5061241 to your computer and use it in GitHub Desktop.
Jsp中处理:
<%
//第三种方式
ServletContext servletContext = request.getSession().getServletContext();
ApplicationContext ctx=WebApplicationContextUtils.getWebApplicationContext(servletContext);
out.println(ctx);//测试
%>
这种方式一般用于在jsp中取Manager,当然其他的你能get到的 都可以获得
jsp 中导入的包
<%@ page import="org.springframework.web.context.support.WebApplicationContextUtils,org.springframework.context.ApplicationContext" %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment