You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Ciaran Hanley <ci...@sentenial.ie> on 2003/12/10 22:36:14 UTC

Validation error: bean not found in any scope

Hey can anybody help me with this validation problem please:
 
I have in my JSP page for printing error messages
 
<logic:messagesPresent>
  <font color="red"><UL>
    <html:messages id="error">
      <LI>
        <bean:write name="error" />
      </LI>
    </html:messages>
  </UL></font><hr>
</logic:messagesPresent>
 
 
I have in my ActionForm class:
 
 
public ActionErrors validate(ActionMapping mapping, HttpServletRequest
request) 
{
  ActionErrors error = super.validate(mapping, request);
                                
  if(error == null) error = new ActionErrors();
 
  if(error.empty())
  {
    if(Integer.toString(getClientAccountNumber()).length() != 10)
    {
                error.add(ActionErrors.GLOBAL_ERROR, new
ActionError("accountnumber", "formerror.accountnumber"));
    }
  }
  return error;
}
 
 
The super.validate() method works fine but my custom validations are
giving me trouble
I am getting a "Cannot find bean error in any scope" error
 
Can anybody help me with this?
 
Thanks In Advance
Ciaran