in the Applicationcontext.xml file, use ${xxx} to indicate that a variable is called "xxx" inside {XXX}.
Example: Configuring a data connection pool in a applicationcontext.xml file
<!-- 配置数据链接池 -->
<property name="dataSource">
<bean class="com.mchange.v2.c3p0.ComboPooledDataSource">
<property name="jdbcUrl" value="${jdbcUrl}"></property>
<property name="driverClass" value="${driverClass}"></property>
<property name="user" value="${user}"></property>
<property name="password" value="${password}"></property>
<!-- 其它配置 -->
<!-- 初始化时获取三个连接,取值应在minPoolSize与maxPoolSize之间。Default:3 -->
<property name="initialPoolSize" value="3"></property>
<!-- 连接池中保留的最小连接数。Default:3 -->
<property name="minPoolSize" value="3"></property>
<!-- 连接池中保留的最大连接数。Default:15 -->
<property name="maxPoolSize" value="15"></property>
<!-- 当连接池中的连接耗尽的时候c3p0一次同时获取的连接数。Default:3 -->
<property name="acquireIncrement" value="3"></property>
<!--
控制数据源内加载preparedStatement数量.如果maxStatements与maxStatementsPerConnection均为0,则缓存被关闭。Default:0
-->
<property name="maxStatements" value="8"></property>
<!--
maxStatementsPerConnection 定义了连接池内单个连接所拥有的最大缓存statements数。Default:0
-->
<property name="maxStatementsPerConnection" value="5"></property>
<!-- 最大空闲时间,1800秒内未使用则连接被丢弃。若为0则永不丢弃。Default:0 -->
<property name="maxIdleTime" value="1800"></property>
</bean>
</property>
The part that is identified in the code is the function that uses the ${}. It is equivalent to calling a variable name in Java. In this example, these variables come from a different properties file. The properties are: jdbc.properties (primarily used to store some of the configuration of the JDBC Connection database for the next change without needing to be modified in the Applicationcontext.xml file.) ) Jdbc.properties:
jdbcUrl=jdbc:mysql://localhost:3306/oa
driverClass=com.mysql.jdbc.Driver
user=root
password=
The Jdbcurl in ${jdbcurl} refers to the Jdbcurl in Jdbc.properties.
From for notes (Wiz)
What does it mean to use ${} in Applicationcontext.xml?