struts1.2中的配置文件ApplicationResources.properties在strust2.0中用什么代替,怎样去使用?

解决方案 »

  1.   

    在struts.properties中通过struts.custom.i18n.resources = msg即可。即在src目录下创建msg.properties
      

  2.   

    <constant name="struts.i18n.reload" value="true" />
    <constant name="struts.custom.i18n.resources" value="message" />
      

  3.   

    既可以在struts.properties里写struts.custom.i18n.resources = abc
    也可以在struts.xml中像楼上那位一样。
      

  4.   

    <constant name="struts.custom.i18n.resources" value="test" />
    test_zh_CN.properties,test_en_US.properties指定全局资源文件在java的包下放置package_language_country.properties资源文件,package为固定写法,处于该包及子包下的action都可以访问该资源。当查找指定key的消息时,系统会先从package资源文件查找,当找不到对应的key时,才会从常量struts.custom.i18n.resources指定的资源文件中寻找
      

  5.   


    <constant name="struts.custom.i18n.resources" value="test" />
    是在那里写的呢?
      

  6.   

    struts2的配置文件中写,我这样写的是在xml中配置
    在properties文件中可以以键值对来写