Class MessageUtilImpl

    • Constructor Detail

      • MessageUtilImpl

        public MessageUtilImpl()
    • Method Detail

      • getText

        public String getText​(String msgKey,
                              Locale locale)
        Description copied from interface: MessageUtil
        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.
        Specified by:
        getText in interface MessageUtil
        Parameters:
        msgKey - key
        locale - the current locale
        Returns:
        text
      • getText

        public String getText​(String msgKey,
                              Object[] args,
                              Locale locale)
        Description copied from interface: MessageUtil
        Convenience method for getting a i18n key's value with arguments.
        Specified by:
        getText in interface MessageUtil
        Parameters:
        msgKey - key
        args - args
        locale - the current locale
        Returns:
        text
      • getText

        public String getText​(String msgKey,
                              String arg,
                              Locale locale)
        Description copied from interface: MessageUtil
        Convenient method for getting a i18n key's value with a single string argument.
        Specified by:
        getText in interface MessageUtil
        Parameters:
        msgKey - message key
        arg - argument
        locale - the current locale
        Returns:
        text
      • saveMessage

        public void saveMessage​(javax.servlet.http.HttpServletRequest request,
                                String msg)
        Description copied from interface: MessageUtil
        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.
        Specified by:
        saveMessage in interface MessageUtil
        Parameters:
        request - request
        msg - msg
      • saveMessage

        public void saveMessage​(javax.servlet.http.HttpServletRequest request,
                                String key,
                                Object parameter,
                                String defaultMessage)
        Description copied from interface: MessageUtil
        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.
        Specified by:
        saveMessage in interface MessageUtil
        Parameters:
        request - request
        parameter - parameter to be filled into the message.
        defaultMessage - default message
      • saveMessage

        public void saveMessage​(javax.servlet.http.HttpServletRequest request,
                                String key,
                                Object[] parameters,
                                String defaultMessage)
        Description copied from interface: MessageUtil
        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.
        Specified by:
        saveMessage in interface MessageUtil
        Parameters:
        request - request
        parameters - Array of parameters to be filled into the message.
        defaultMessage - default message
      • saveMessage

        public void saveMessage​(javax.servlet.http.HttpServletRequest request,
                                String key,
                                String defaultMessage)
        Description copied from interface: MessageUtil
        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.
        Specified by:
        saveMessage in interface MessageUtil
        Parameters:
        request - request
        key - key
        defaultMessage - default message
      • saveMessage

        public void saveMessage​(javax.servlet.http.HttpSession session,
                                String msg)
        Description copied from interface: MessageUtil
        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.
        Specified by:
        saveMessage in interface MessageUtil
        Parameters:
        session - session
        msg - msg