资源文件确定没问题?
有这一项jsp.hello.errors?

解决方案 »

  1.   

    你放入request域改为this.addErrors(request, errors);
    这回看看
      

  2.   

    而且你页面html:error 应该改为html:errors吧
      

  3.   

    <html:error property="userName" />改为<html:errors property="userName" />
      

  4.   

    加上这句
    saveErrors(arg2, errors);
      

  5.   

    加上这句 
    saveErrors(request, errors);
      

  6.   

    配置问题,你为什么不写ACTIONMESSAGES
      

  7.   

    import org.apache.struts.action.ActionError;
    import org.apache.struts.action.ActionErrors;public final class xxx extends Action {public ActionForward execute(ActionMapping mapping, ActionForm form, 
    HttpServletRequest request, HttpServletResponse response) { 
    LoginsForm loginsForm = (LoginsForm) form;// TODO Auto-generated method stub 
    ActionErrors errors=new ActionErrors(); 
    if((loginsForm.getUsername()==null) ¦ ¦(loginsForm.getUsername().length() <1)){ 
    ActionError error=new ActionError("error.missing.username");
    errors.add(ActionErrors.GLOBAL_ERROR,error); 

    session.setAttribute("username", username);
    return mapping.findForward("success");

    } } 
    jsp
    <html:errors/>
    <html:form action="/xxxx.do">
     xxxxxxxxxxxxxxx
    </html:form>ApplicationResource.properties文件
    #Application Resource for the xxx.java
    error.missing.username=<li><font color="red">error</font></li>