XML : Set spring profile in setenv.bat and read dinamicaly from web.xml or xml bean file

I need detect dynamically which is the spring profile send it in setenv.bat

My setenv.bat has

  set "JAVA_OPTS= -Dspring.profiles.active=dev"    

and in web.xml has

  <context-param>      <param-name>spring.profiles.active</param-name>      <param-value>${spring.profiles.active}</param-value>  </context-param>    

but doesn't works.

Other way is using profile tag in xml

  <?xml version="1.0" encoding="UTF-8"?>  <beans xmlns="http://www.springframework.org/schema/beans"  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:int="http://www.springframework.org/schema/integration"  xmlns:int-http="http://www.springframework.org/schema/integration/http"  xmlns:context="http://www.springframework.org/schema/context"  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd      http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd      http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd      http://www.springframework.org/schema/integration/http http://www.springframework.org/schema/integration/http/spring-integration-http.xsd"      profile="${spring.profiles.active}">     . . . .   </beans>    

but doesn't works too

I am using spring 4.1.5 release

I don't know how can I get it, how can I?

No comments:

Post a Comment