首先你先在.properties
文件中以键值对的形式写好之后,在spring
配置文件先将这个资源
文件初始化成bean,然后再在XML中以${……}的形式取出里边的值。 在spring中的配置是: <!-- 配置的资源
文件 --> <bean id="propertyCon
figurer" class="org.springframework.beans.factory.con
fig.PropertyPlaceholderConfi gurer"> <property name="locations"> <list> <value>cla
sspath:/sy
stem.properties</value> </list> </property> </bean> 在properties
文件中书写格式: @R_768_
404[email protected] = 127.0.0.1 在其他的xml中使用方式 ${@R_768_
404[email protected]}取出里边的值