FileDocCategorySizeDatePackage
BaseActionForm.javaAPI DocExample1206Thu Dec 04 08:19:26 GMT 2003org.springframework.samples.jpetstore.web.struts

BaseActionForm

public class BaseActionForm extends org.apache.struts.action.ActionForm

Fields Summary
Constructors Summary
Methods Summary
protected voidaddErrorIfStringEmpty(java.util.List errors, java.lang.String message, java.lang.String value)

    if (value == null || value.trim().length() < 1) {
      errors.add(message);
    }
  
public voiddoValidate(org.apache.struts.action.ActionMapping mapping, javax.servlet.http.HttpServletRequest request, java.util.List errors)

  
public org.apache.struts.action.ActionErrorsvalidate(org.apache.struts.action.ActionMapping mapping, javax.servlet.http.HttpServletRequest request)

    ActionErrors actionErrors = null;
    ArrayList errorList = new ArrayList();
    doValidate(mapping, request, errorList);
    request.setAttribute("errors", errorList);
    if (!errorList.isEmpty()) {
      actionErrors = new ActionErrors();
      actionErrors.add(ActionErrors.GLOBAL_ERROR, new ActionError("global.error"));
    }
    return actionErrors;