if (errors != null && errors.size() > 0) {
if (errors != null && errors.hasFieldErrors()) {
    protected void setFocusOnFieldIfRequired(InputTagSupport tag) {        // Decide whether or not this field should be focused        if (this.focus != null && !this.focusSet) {            ActionBean bean = getActionBean();            ValidationErrors errors = bean == null ? null : bean.getContext().getValidationErrors();            // If there are validaiton errors, select the first field in error            if (errors != null && errors.size() > 0) {                List<ValidationError> fieldErrors = errors.get(tag.getName());                if (fieldErrors != null && fieldErrors.size() > 0) {                    tag.setFocus(true);                    this.focusSet = true;                }            }            // Else set the named field, or the first field if that's desired            else if (this.focus.equals(tag.getName())) {                    tag.setFocus(true);                    this.focusSet = true;            }            else if ("".equals(this.focus) || "first".equalsIgnoreCase(this.focus)) {                if ( !(tag instanceof InputHiddenTag) ) {                    tag.setFocus(true);                    this.focusSet = true;                }            }        }    }