你要在struts-config.xml里配置你的属性文件
 <message-resources parameter="xxx.xxx.xxxResource_zh" />

解决方案 »

  1.   

    ActionErrors errors=new ActionErrors();
                        
                  if(name.trim().equals(""))
                  {
                       ActionMessage error = new ActionMessage("error.user_name");                   errors.add("user_name",error);  
                       
                  }
                  if(key.trim().equals(""))
                  {                  ActionMessage error = new ActionMessage("error.user_key");                   errors.add("user_key",error);   
                       
                  }
    这个代码写完后你有没有写这一句: return errors;还有,配置文件中
    <action input="/login.jsp" name="userActionForm" path="/loginAction" scope="request" type="userstruts.LoginAction" validate="true">
    input页面有没有指定?
      

  2.   

    input我制定了,return errors;我也写了,只是没有帖出来
      

  3.   

    楼主没有描述完全问题的性质,请按下步骤尝试解决问题(版本1):1.有没有返回到你的input页?
    Y:转6
    N:转2.2.有没有在Struts配置里配制你的validation Plugin(即有plug-in className="org.apache.struts.validator.ValidatorPlugIn")?
    N:添加ValidatorPlugIn的配置
    Y:转33.有没有在Struts配置里给className="org.apache.struts.validator.ValidatorPlugIn"指定正确的pathnames?
    Y:转4
    N:设置正确的pathnames5.有没有在你的pathnames指定的xml里配置你的调用path
    Y:……(偶也暂时搞不清楚)
    N:配置调用path6.检查你的Form的Validate方法有没有调用到?
    Y:检查是否有return你的errors
    N:转77.检查你的Form类的继承关系是否正确?
    Y:转8
    N:更改继承的关系8:检查你的覆盖的Validate方法是否覆盖了正确的父类方法?
    Y:……(偶也暂时搞不清楚)
    N:更改覆盖的方法