Spring 解析资源文件
我们把资源信息放置到properties文件中
通过配制bean来访问资源文件
<bean id="messageSource" class="org.springframework.context.support
ResourceBundleMessageSource">
<property name="basename">
<value>fileName</value>
</property>
</bean>
其中bean的名字必须是messageSource。
context.getMessage("computer",new Object[0],locale)得到computer的值。
<spring:message code="computer"/>
我们把资源信息放置到properties文件中
通过配制bean来访问资源文件
<bean id="messageSource" class="org.springframework.context.support
ResourceBundleMessageSource">
<property name="basename">
<value>fileName</value>
</property>
</bean>
其中bean的名字必须是messageSource。
context.getMessage("computer",new Object[0],locale)得到computer的值。
<spring:message code="computer"/>