code: public static MessageEmit getMessageObj(final String id,
                                            final Object caller,
                                            final HttpServletRequest request,
                                            final MessageResources messages,
                                            final String messageObjAttrName,
                                            final String errProp,
                                            final boolean clear) {
      if (messageObjAttrName == null) {
        // don't set
        return null;
      }
  
      HttpSession sess = request.getSession(false);
  
      if (sess == null) {
        logger.error("No session!!!!!!!");
        return null;
      }
  
      Object o = sess.getAttribute(messageObjAttrName);
      MessageEmit msg = null;
  
      // Ensure it's initialised correctly
      if ((o != null) && (o instanceof MessageEmitSvlt)) {
        if (((MessageEmitSvlt)o).getMessages() != null) {
          msg = (MessageEmit)o;
        }
      }
  
      if (msg == null) {
        msg = new MessageEmitSvlt();
      }
  
      ((MessageEmitSvlt)msg).reinit(id, caller, messages, new ActionMessages(),
                                    errProp, clear);
  
      // Implant in session
  
      sess.setAttribute(messageObjAttrName, msg);
  
      return msg;
    }
docs: Get the message object. If we haven't already got one and
  getMessageObjAttrName returns non-null create one and implant it in
  the session.
  
  @param id                Identifying string for messages
  @param caller            Used for log identification
  @param request           Needed to locate session
  @param messages           MessageResources object for creating new object
  @param messageObjAttrName  name of session attribute
  @param errProp           name of exception message property
  @param clear             the list
  @return MessageEmit      null on failure