I'm developing Spring MVC application. In my application I have two profiles, test and production. Test is enable when I deploy my app to test envirionemnt, Production on production environment.
I need to get current profile in jsp file. Is it possible ? I don't want to send additional variable to get this information because file is included to lot of others files. Thanks
You can use something like the following:
ServletContext sc = request.getSession().getServletContext();
WebApplicationContext applicationContext = WebApplicationContextUtils.getWebApplicationContext(sc);
String[] profiles = applicationContext.getEnvironment().getActiveProfiles();
Thanks for quick response but, sorry, I don't understand it. I asked if can I get information which profile is active from JSP code. Whay should I store additional properties in file or database to resolve my problem?