取得spring上下文

来源:互联网 发布:中国网络远程学校 编辑:程序博客网 时间:2024/05/22 13:12

WebApplicationContext webApplicationContext = ContextLoader.getCurrentWebApplicationContext();

ServletContext servletContext= webApplicationContext.getServletContext();

String path = servletContext.getContextPath();
1 0
原创粉丝点击