Interface MvcMessages

All Known Implementing Classes:
MvcMessagesImpl

public interface MvcMessages

Represents a list of messages to be displayed to the user.

Instances implementing this interface must be injectable using Inject and are RedirectScoped.

  • Method Details

    • add

      MvcMessages add(String text)
      Adds a new global info message.
      Parameters:
      text - The text of the message, must not be null
      Returns:
      self
    • add

      MvcMessages add(MvcMessage.Severity severity, String text)
      Adds a new global message with the given severity.
      Parameters:
      severity - The severity of the message, must not be null
      text - The text of the message, must not be null
      Returns:
      self
    • add

      MvcMessages add(jakarta.mvc.binding.BindingResult bindingResult)
      This method adds one error message for each binding error or constraint violation in the given binding result.
      Parameters:
      bindingResult - The binding result to create messages from, ust not be null
      Returns:
      self
    • add

      MvcMessages add(MvcMessage message)
      Adds the given message.
      Parameters:
      message - the message
      Returns:
      self
    • getAll

      List<MvcMessage> getAll()
      Returns a list of all messages
      Returns:
      all messages
    • getInfos

      List<MvcMessage> getInfos()
      Returns a list of all messages with a severity of INFO.
      Returns:
      all info messages
    • getWarnings

      List<MvcMessage> getWarnings()
      Returns a list of all messages with a severity of WARNING.
      Returns:
      all warning messages
    • getErrors

      List<MvcMessage> getErrors()
      Returns a list of all messages with a severity of ERROR.
      Returns:
      all error messages
    • getMessage

      MvcMessage getMessage(String param)
      If there is at least one message queued for the given parameter, the first one is returned. Will return null if no message for the parameter exists.
      Parameters:
      param - The parameter name
      Returns:
      The first message for the parameter or null
      See Also:
    • getMessages

      List<MvcMessage> getMessages(String param)
      Returns a list of all messages queued for the given parameter.
      Parameters:
      param - The parameter name
      Returns:
      All message for the given parameter
      See Also: