Interface MessageUtil

  • All Known Implementing Classes:
    MessageUtilImpl

    public interface MessageUtil
    Provides methods for putting messages to the user in the session.
    Author:
    paul
    • Method Detail

      • getText

        String getText​(String msgKey,
                       Locale locale)
        Convenience method for getting a i18n key's value. Implementation note: Calling getMessageSourceAccessor() is used because the RequestContext variable is not set in unit tests b/c there's no DispatchServlet Request.
        Parameters:
        msgKey - key
        locale - the current locale
        Returns:
        text
      • getText

        String getText​(String msgKey,
                       Object[] args,
                       Locale locale)
        Convenience method for getting a i18n key's value with arguments.
        Parameters:
        msgKey - key
        args - args
        locale - the current locale
        Returns:
        text
      • getText

        String getText​(String msgKey,
                       String arg,
                       Locale locale)
        Convenient method for getting a i18n key's value with a single string argument.
        Parameters:
        msgKey - message key
        arg - argument
        locale - the current locale
        Returns:
        text
      • saveMessage

        void saveMessage​(javax.servlet.http.HttpServletRequest request,
                         String msg)
        Put a message into the session. These can be displayed to the user. Messages accumulate in a list until they are viewed in messages.jsp - at which point they are removed from the session.
        Parameters:
        request - request
        msg - msg
      • saveMessage

        void saveMessage​(javax.servlet.http.HttpServletRequest request,
                         String key,
                         Object parameter,
                         String defaultMessage)
        Put a message into the session. These can be displayed to the user. Messages accumulate in a list until they are viewed in messages.jsp - at which point they are removed from the session.
        Parameters:
        request - request
        parameter - parameter to be filled into the message.
        defaultMessage - default message
      • saveMessage

        void saveMessage​(javax.servlet.http.HttpServletRequest request,
                         String key,
                         Object[] parameters,
                         String defaultMessage)
        Put a message into the session. These can be displayed to the user. Messages accumulate in a list until they are viewed in messages.jsp - at which point they are removed from the session.
        Parameters:
        request - request
        parameters - Array of parameters to be filled into the message.
        defaultMessage - default message
      • saveMessage

        void saveMessage​(javax.servlet.http.HttpServletRequest request,
                         String key,
                         String defaultMessage)
        Put a message into the session. These can be displayed to the user. Messages accumulate in a list until they are viewed in messages.jsp - at which point they are removed from the session.
        Parameters:
        request - request
        key - key
        defaultMessage - default message
      • saveMessage

        void saveMessage​(javax.servlet.http.HttpSession session,
                         String msg)
        Put a message into the session. These can be displayed to the user. Messages accumulate in a list until they are viewed in messages.jsp - at which point they are removed from the session.
        Parameters:
        session - session
        msg - msg