这个问题用struts是没办法解决的。他读去资源文件是有自己的一套顺序,程序无法控制。

解决方案 »

  1.   

    eg# Project manager和role
    hello.jsp.title=xxxxxxxxxxx
    hello.jsp.page.heading=xxxxxxxxxxxxxxxx# Project role
    hello.errors=xxxxxxxxxxxxxxxx
    hello.errors.xxxx=xxxxxxxxxxxxxx
      

  2.   

    不好意思上面写错了eg# Project managerhello.jsp.title=xxxxxxxxxxx
    hello.jsp.page.heading=xxxxxxxxxxxxxxxx# Project role
    hello.errors=xxxxxxxxxxxxxxxx
    hello.errors.xxxx=xxxxxxxxxxxxxx
      

  3.   

    validate有没有什么属性来设置读取哪个资源文件
      

  4.   

    用一下代码来设置读取哪个资源文件
    //load the resource bundle
    ResourceBundle bundle=ResourceBundle.getBundle("com.yourcompany.struts.application");
    用一下代码来设置读取资源文件的那个key
    //get the message template
    String temp=bundle.getString("login.jsp.label.password");
      

  5.   

    希望大家共同学习.....
    欢迎高手加入!!!!!!!!!!!!!QQ群:   唯爱J2EE(联盟):20390984(招人)   唯爱J2EE(java开发):14402276(人员已满)
       
       唯爱J2EE(WEB):33308970(人员已满)
      
    ********************不要重复加入,谢谢**************************
    此群只加J2EE方面的人才与高手...或搞JAVA 一年以上的.....其他人不加........加群时,,注明:J2EE方面的技术体系,,,如:Struts,Spring,Hibenate,EJB,JSF,Ajax,Oracle,Weblogic等有关技术,方能通过....
      

  6.   

    在struts-cfg.xml文件中写:
    <message-resources parameter="com.yourcompany.struts.ApplicationResources_zh_CN" />
    <message-resources key="messageValidator"  parameter="com.yourcompany.struts.ApplicationValidator" />在jsp中如果要显示com.yourcompany.struts.ApplicationValidator包的资源文件,该这样写:
    <bean:message key="error" bundle="messageValidator">
    这样将输出com.yourcompany.struts.ApplicationValidator这个资源文件中error定义的消息文本.
      

  7.   


                          希望大家共同学习.....
    ㄒо:J2EE盟友,群论坛地址:http://www.NetJava.org 欢迎高手加入!!!!!!!!!!!!!
    QQ群:   唯爱J2EE(联盟):20390984(招人)   唯爱J2EE(java开发):14402276(人员已满)
       
       唯爱J2EE(WEB):33308970(人员已满)
      
    ********************不要重复加入,谢谢**************************
    此群只加J2EE方面的人才与高手...或搞JAVA 一年以上的.....其他人不加........加群时,,注明:J2EE方面的技术体系,,,如:Struts,Spring,Hibenate,EJB,JSF,Ajax,Oracle,Weblogic等有关技术,方能通过....
      

  8.   

    不好意思,最近忘了这事了。
    不过你们说的方法都没用,可能我没说清楚。
    <formset>
    <form name="/manager/addOrupdate">
       <field property="managername" depends="required">
         <arg0 key="manager.name"/>
       </field>
    </form>
    </formset>看到 <arg0 key="manager.name"/>了吧!这个key就是引用资源文件的,但是无法指定资源文件,我想问的就是“怎么让他引用指定的资源文件”。不用我说大家都知道这段话是哪里的吧!
      

  9.   

    借用一下CHENXIANJUNJUN() 大哥的代码在struts-cfg.xml文件中写:
    <message-resources parameter="com.yourcompany.struts.ApplicationResources_zh_CN" />
    <message-resources key="messageValidator"  parameter="com.yourcompany.struts.ApplicationValidator" />
    <arg0 key="manager.name" bundle="messageValidator"/>