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