/**
     * Add an error message to the set of errors for the specified property.
     *
     * @param property Property name (or ActionErrors.GLOBAL_ERROR)
     * @param error The error message to be added
     * @deprecated Use add(String, ActionMessage) instead.  This will be
     * removed after Struts 1.2.
     */
errors.add("username",new ActionError("error.login.NullUserName")); --〉
errors.add("username",new ActionMessage("error.login.NullUserName"));

解决方案 »

  1.   

    是不是用的Struts1.2

    因为在1.2
    中ActionErrors 已经被捕推荐使用了
    用ActionMessages你的errors是不是一个ActionErrors 的 对象
      

  2.   

    我的 errors 是一个ActionErrors 的 对象,谢谢,问题已经解决,,
    顺便问一下,  ActionError与ActionMessage有什么不同之处么?
    在一个我从官网下的框架是Struts1.2,但myeclipse4.0只能识别为Struts1.1,这又是怎么一回事呢???
      

  3.   

    不好意思!现在最新的是4.1,支持struts1.2,记错了!
    抱歉!!!