在applicationContext.xml加载一个bean
<bean id=”messageSource” class=”org.springframework.context.support.ResourceBundleMessageSource”>
<property name=”basename”>
<value>message</value>
</property>
</bean>
在src目录下建多个properties文件
对于非英文的要用native2ascii -encoding gb2312 源 目转化文件相关内容
其命名格式是message_语言_国家。
页面中的中显示提示信息,键名取键值。
当给定国家,系统会自动加载对应的国家的properties信息。
通过applictionContext.getMessage(“键名”,”参数”,”区域”)取出相关的信息。
<bean id=”messageSource” class=”org.springframework.context.support.ResourceBundleMessageSource”>
<property name=”basename”>
<value>message</value>
</property>
</bean>
在src目录下建多个properties文件
对于非英文的要用native2ascii -encoding gb2312 源 目转化文件相关内容
其命名格式是message_语言_国家。
页面中的中显示提示信息,键名取键值。
当给定国家,系统会自动加载对应的国家的properties信息。
通过applictionContext.getMessage(“键名”,”参数”,”区域”)取出相关的信息。