spring EL表达式的简单使用
1、项目加载中读取配置文件:
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
classpath*:spring/spring_*.xml,
classpath:kernel/dubboProvider/All.xml
</param-value>
</context-param>

2、还需要配置
<listener>
<listener-class> org.springframework.web.context.ContextLoaderListene </listener-class>
</listener>

3、在ContextLoaderListener加载时,会查找名为contextConfigLocation的参数。因此,配置<context-param>时参数名字应该是contextConfigLocation。

4、 <!-- 引入配置文件 -->
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="fileEncoding" value="UTF-8" />
<property name="ignoreUnresolvablePlaceholders" value="true" />
<property name="locations">
<list>
<value>classpath:redis.properties</value>

5、 <value>classpath:serviceToken.properties</value>
<value>classpath:config.properties</value>
<value>classpath:reconciliation.properties</value>
</list>
</property>
</bean>
引入propertyConfigurer,并生成实体,这里就可以在任意地方使用springel表达式了

6、 @Value("${weixin.appId}")
private String appId;
@Value("${weixin.order}")
private String orderUrl;
@Value("${weixin.mergeOrderUrl}")
直接使用$获取。但是要和配置文件对应。

7、generalPay.remote.port=${general.pay.remote.port}
weixin.secret=${filter.weixin.secret}
weixin.appId=${filter.weixin.appId}

1、最后在pom.xml配置参数信息,即可。