/** * Retrieve the Errors instance for the given bind object, using the "defaultHtmlEscape" setting. * @param name name of the bind object * @return the Errors instance, or {@code null} if not found */ @Nullable public Errors getErrors(String name) { return getErrors(name, isDefaultHtmlEscape()); }
/** * Retrieve the Errors instance for the given bind object, using the "defaultHtmlEscape" setting. * @param name name of the bind object * @return the Errors instance, or {@code null} if not found */ @Nullable public Errors getErrors(String name) { return getErrors(name, isDefaultHtmlEscape()); }
@Override protected final int doStartTagInternal() throws ServletException, JspException { this.errors = getRequestContext().getErrors(this.name, isHtmlEscape()); if (this.errors != null && this.errors.hasErrors()) { this.pageContext.setAttribute(ERRORS_VARIABLE_NAME, this.errors, PageContext.REQUEST_SCOPE); return EVAL_BODY_INCLUDE; } else { return SKIP_BODY; } }
@Override protected final int doStartTagInternal() throws ServletException, JspException { this.errors = getRequestContext().getErrors(this.name, isHtmlEscape()); if (this.errors != null && this.errors.hasErrors()) { this.pageContext.setAttribute(ERRORS_VARIABLE_NAME, this.errors, PageContext.REQUEST_SCOPE); return EVAL_BODY_INCLUDE; } else { return SKIP_BODY; } }
this.errors = requestContext.getErrors(beanName, false);
this.errors = requestContext.getErrors(beanName, false);
@Override public Optional<Errors> getErrors(final String name) { return Optional.ofNullable(this.requestContext.getErrors(name)); }
@Override public Optional<Errors> getErrors(final String name, final boolean htmlEscape) { return Optional.ofNullable(this.requestContext.getErrors(name, htmlEscape)); }
/** * Retrieve the Errors instance for the given bind object, using the "defaultHtmlEscape" setting. * @param name name of the bind object * @return the Errors instance, or {@code null} if not found */ public Errors getErrors(String name) { return getErrors(name, isDefaultHtmlEscape()); }
private static boolean isBound(final RequestContext requestContext, final String completeExpression) { final int dotPos = completeExpression.indexOf('.'); if (dotPos == -1) { // Spring only allows second-level binding for conversions! ("x.y", not "x") return false; } // The bound bean name is everything before the first dot (or everything, if no dot present) final String beanName = completeExpression.substring(0, dotPos); // The getErrors() method is not extremely efficient, but it has a cache map, so it should be fine final boolean beanValid = requestContext.getErrors(beanName, false) != null; if (beanValid && completeExpression.length() > dotPos) { final String path = completeExpression.substring(dotPos + 1, completeExpression.length()); // We will validate the rest of the expression as a bean property identifier or a bean property expression. return validateBeanPath(path); } return false; }
private static boolean isBound(final RequestContext requestContext, final String completeExpression) { final int dotPos = completeExpression.indexOf('.'); if (dotPos == -1) { // Spring only allows second-level binding for conversions! ("x.y", not "x") return false; } // The bound bean name is everything before the first dot (or everything, if no dot present) final String beanName = completeExpression.substring(0, dotPos); // The getErrors() method is not extremely efficient, but it has a cache map, so it should be fine final boolean beanValid = requestContext.getErrors(beanName, false) != null; if (beanValid && completeExpression.length() > dotPos) { final String path = completeExpression.substring(dotPos + 1, completeExpression.length()); // We will validate the rest of the expression as a bean property identifier or a bean property expression. return validateBeanPath(path); } return false; }
private static boolean isBound(final RequestContext requestContext, final String completeExpression) { final int dotPos = completeExpression.indexOf('.'); if (dotPos == -1) { // Spring only allows second-level binding for conversions! ("x.y", not "x") return false; } // The bound bean name is everything before the first dot (or everything, if no dot present) final String beanName = completeExpression.substring(0, dotPos); // The getErrors() method is not extremely efficient, but it has a cache map, so it should be fine final boolean beanValid = requestContext.getErrors(beanName, false) != null; if (beanValid && completeExpression.length() > dotPos) { final String path = completeExpression.substring(dotPos + 1, completeExpression.length()); // We will validate the rest of the expression as a bean property identifier or a bean property expression. return validateBeanPath(path); } return false; }
private static boolean isBound(final RequestContext requestContext, final String completeExpression) { final int dotPos = completeExpression.indexOf('.'); if (dotPos == -1) { // Spring only allows second-level binding for conversions! ("x.y", not "x") return false; } // The bound bean name is everything before the first dot (or everything, if no dot present) final String beanName = completeExpression.substring(0, dotPos); // The getErrors() method is not extremely efficient, but it has a cache map, so it should be fine final boolean beanValid = requestContext.getErrors(beanName, false) != null; if (beanValid && completeExpression.length() > dotPos) { final String path = completeExpression.substring(dotPos + 1, completeExpression.length()); // We will validate the rest of the expression as a bean property identifier or a bean property expression. return validateBeanPath(path); } return false; }
@Override protected final int doStartTagInternal() throws ServletException, JspException { this.errors = getRequestContext().getErrors(this.name, isHtmlEscape()); if (this.errors != null && this.errors.hasErrors()) { this.pageContext.setAttribute(ERRORS_VARIABLE_NAME, this.errors, PageContext.REQUEST_SCOPE); return EVAL_BODY_INCLUDE; } else { return SKIP_BODY; } }
this.errors = requestContext.getErrors(beanName, false);