|
该用户从未签到
|
- <!-- 国际化的消息资源文件 -->( Q3 ^; H1 n U6 Z' `) b; E
- <bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
' a2 r, d: o0 S - <property name="basenames">+ A$ \7 c3 I1 X, L) r
- <list>
* ]! a1 i& P. c - <!-- 在web环境中一定要定位到classpath 否则默认到当前web应用下找 -->
1 h4 f* u- s) S% {3 f9 |- E1 S" L - <value>classpath:messages</value>
0 _( U Y6 Z1 O* B# {! O: M6 b - </list>
/ @0 k1 w( q+ _ - </property>
" g2 @9 @! F) [: D5 ?2 d - <property name="defaultEncoding" value="UTF-8"/>- o+ }+ \2 K5 p4 A3 R
- <property name="cacheSeconds" value="60"/>
% T% Q! P7 E; ^( R( }4 M6 z - </bean>
复制代码 此处basenames内一定是 classpath:messages ,如果你写出“messages”,将会到你的web应用的根下找 即你的messages.properties一定在 web应用/messages.propertis。9 O7 g# B# }9 N1 L7 l& z
|
|