Spring 获取当前activeProfile

WebApplicationContext wac = WebApplicationContextUtils.getWebApplicationContext(getServletContext());
String profile = wac.getEnvironment().getActiveProfiles()[0];

 

posted @ 2018-04-08 08:50  梦见舟  阅读(5795)  评论(0编辑  收藏  举报