Tabnine Logo
ErrorsTag.getBindStatus
Code IndexAdd Tabnine to your IDE (free)

How to use
getBindStatus
method
in
org.springframework.web.servlet.tags.form.ErrorsTag

Best Java code snippets using org.springframework.web.servlet.tags.form.ErrorsTag.getBindStatus (Showing top 6 results out of 315)

origin: spring-projects/spring-framework

/**
 * Should rendering of this tag proceed at all?
 * <p>Only renders output when there are errors for the configured {@link #setPath path}.
 * @return {@code true} only when there are errors for the configured {@link #setPath path}
 */
@Override
protected boolean shouldRender() throws JspException {
  try {
    return getBindStatus().isError();
  }
  catch (IllegalStateException ex) {
    // Neither BindingResult nor target object available.
    return false;
  }
}
origin: spring-projects/spring-framework

/**
 * Exposes any bind status error messages under {@link #MESSAGES_ATTRIBUTE this key}
 * in the {@link PageContext#PAGE_SCOPE}.
 * <p>Only called if {@link #shouldRender()} returns {@code true}.
 * @see #removeAttributes()
 */
@Override
protected void exposeAttributes() throws JspException {
  List<String> errorMessages = new ArrayList<>();
  errorMessages.addAll(Arrays.asList(getBindStatus().getErrorMessages()));
  this.oldMessages = this.pageContext.getAttribute(MESSAGES_ATTRIBUTE, PageContext.PAGE_SCOPE);
  this.pageContext.setAttribute(MESSAGES_ATTRIBUTE, errorMessages, PageContext.PAGE_SCOPE);
  this.errorMessagesWereExposed = true;
}
origin: org.springframework/spring-webmvc

/**
 * Should rendering of this tag proceed at all?
 * <p>Only renders output when there are errors for the configured {@link #setPath path}.
 * @return {@code true} only when there are errors for the configured {@link #setPath path}
 */
@Override
protected boolean shouldRender() throws JspException {
  try {
    return getBindStatus().isError();
  }
  catch (IllegalStateException ex) {
    // Neither BindingResult nor target object available.
    return false;
  }
}
origin: org.springframework/spring-webmvc

/**
 * Exposes any bind status error messages under {@link #MESSAGES_ATTRIBUTE this key}
 * in the {@link PageContext#PAGE_SCOPE}.
 * <p>Only called if {@link #shouldRender()} returns {@code true}.
 * @see #removeAttributes()
 */
@Override
protected void exposeAttributes() throws JspException {
  List<String> errorMessages = new ArrayList<>();
  errorMessages.addAll(Arrays.asList(getBindStatus().getErrorMessages()));
  this.oldMessages = this.pageContext.getAttribute(MESSAGES_ATTRIBUTE, PageContext.PAGE_SCOPE);
  this.pageContext.setAttribute(MESSAGES_ATTRIBUTE, errorMessages, PageContext.PAGE_SCOPE);
  this.errorMessagesWereExposed = true;
}
origin: spring-projects/spring-framework

@Override
protected void renderDefaultContent(TagWriter tagWriter) throws JspException {
  tagWriter.startTag(getElement());
  writeDefaultAttributes(tagWriter);
  String delimiter = ObjectUtils.getDisplayString(evaluate("delimiter", getDelimiter()));
  String[] errorMessages = getBindStatus().getErrorMessages();
  for (int i = 0; i < errorMessages.length; i++) {
    String errorMessage = errorMessages[i];
    if (i > 0) {
      tagWriter.appendValue(delimiter);
    }
    tagWriter.appendValue(getDisplayString(errorMessage));
  }
  tagWriter.endTag();
}
origin: org.springframework/spring-webmvc

@Override
protected void renderDefaultContent(TagWriter tagWriter) throws JspException {
  tagWriter.startTag(getElement());
  writeDefaultAttributes(tagWriter);
  String delimiter = ObjectUtils.getDisplayString(evaluate("delimiter", getDelimiter()));
  String[] errorMessages = getBindStatus().getErrorMessages();
  for (int i = 0; i < errorMessages.length; i++) {
    String errorMessage = errorMessages[i];
    if (i > 0) {
      tagWriter.appendValue(delimiter);
    }
    tagWriter.appendValue(getDisplayString(errorMessage));
  }
  tagWriter.endTag();
}
org.springframework.web.servlet.tags.formErrorsTaggetBindStatus

Popular methods of ErrorsTag

  • getElement
    Get the HTML element must be used to render the error messages.
  • doEndTag
  • doStartTag
  • evaluate
  • getDelimiter
    Return the delimiter to be used between error messages.
  • getPropertyPath
  • setPageContext
  • setPath
  • writeDefaultAttributes
  • <init>
  • getDisplayString
  • setBodyContent
  • getDisplayString,
  • setBodyContent,
  • setParent,
  • doAfterBody,
  • doFinally,
  • doInitBody,
  • release,
  • setCssClass,
  • setCssStyle

Popular in Java

  • Reading from database using SQL prepared statement
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getResourceAsStream (ClassLoader)
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • Timer (java.util)
    Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
  • Join (org.hibernate.mapping)
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now