I am bit new on Spring Platform. I am implementing XML based Spring Profiles.
I have declared one profile in web.xml like
<context-param>
<param-name>spring.profiles.active</param-name>
<param-value>dev</param-value>
</context-param>
I want to get active profile value in my Java Class.
Here is my first attempt but it doesn't work due to some problems.
GenericXmlApplicationContext ctx = new GenericXmlApplicationContext();
String profiles[] = ctx.getEnvironment().getActiveProfiles();
System.out.println(profiles[0]);
It displays me null value.Is there any idea how to activate profile in Java class?