五种方式在java中读取properties文件中的内容 - AichaelLee/Summary GitHub Wiki

https://www.cnblogs.com/hafiz/p/5876243.html

springMVC Controller 和 Service 通过@value 读取properties配置信息

	<!-- @Value -->
	<bean id="configProperties"
		class="org.springframework.beans.factory.config.PropertiesFactoryBean">
		<property name="locations">
			<list>
				<value>classpath:MailUrl.properties</value>
			</list>
		</property>
	</bean>
	<bean id="propertyConfigurer"
		class="org.springframework.beans.factory.config.PreferencesPlaceholderConfigurer">
		<property name="properties" ref="configProperties" />
	</bean>

@Value("${sessionTimeOut}")
private int sessionTimeOut;

⚠️ **GitHub.com Fallback** ⚠️