Spring 获取当前activeProfile

WebApplicationContext wac = WebApplicationContextUtils.getWebApplicationContext(getServletContext());
String profile = wac.getEnvironment().getActiveProfiles()[0];
原文地址:https://www.cnblogs.com/mengjianzhou/p/8742777.html