Class DisplayMessage


  • public class DisplayMessage
    extends Object
    Store a message in the session, so it can be displayed on the page. Getting the message also removes it from the session, so the same message is not displayed repeatedly.
    • Constructor Detail

      • DisplayMessage

        public DisplayMessage()
    • Method Detail

      • setMessage

        public static void setMessage​(javax.servlet.http.HttpServletRequest request,
                                      String message)
        Store this message on the session. This will overwrite any previously stored message.
      • setMessage

        public static void setMessage​(javax.servlet.http.HttpSession session,
                                      String message)
        Store this message on the session. This will overwrite any previously stored message.
      • getMessageAndClear

        public static String getMessageAndClear​(javax.servlet.http.HttpServletRequest request)
        Get the current message from the session, and remove it from the session so it won't be displayed again. If there is no message, return the empty string.
      • getMessageAndClear

        public static String getMessageAndClear​(javax.servlet.http.HttpSession session)
        Get the current message from the session, and remove it from the session so it won't be displayed again. If there is no message, return the empty string.