Spring 获取当前activeProfile

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

 

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