日期:2014-05-18  浏览次数:20659 次

SpringMVC的国际化问题
请教:现在有个项目用的spring的mvc,做国际化时页面标签只能找到中文的资源文件,我把控制面板里的区域和语言设置为英文美国,页面还是显示中文。

 我的配置文件:
  <bean   id= "messageSource "        class= "org.springframework.context.support.ResourceBundleMessageSource ">
                <property   name= "basenames ">
                <list>
                <value> com/common/properties/messages </value>
                <value> com/common/properties/errors </value>
                <value> com/common/properties/theme </value>
                </list>
                </property>
      </bean>
 
 页面标签:
    <%@   taglib   uri= "http://java.sun.com/jstl/fmt "   prefix= "fmt "   %>
    <fmt:message   key= "zhongguo "   />

  谢谢请赐教!


------解决方案--------------------
测试的话不是在你控制面板里设置区域和语言设置
ie为例
internet选项-->常规-->语言
------解决方案--------------------
只要你严格按找资源文件规则命名就ok
他是根据os的不同去 改变