code: public static MessageEmit getErrorObj(final String id,
                                          final Object caller,
                                          final HttpServletRequest request,
                                          final MessageResources messages,
                                          final String errorObjAttrName,
                                          final String errProp,
                                          final boolean noActionErrors,
                                          final boolean clear) {
      if (errorObjAttrName == null) {
        // don't set
        return null;
      }
  
      HttpSession sess = request.getSession(false);
  
      if (sess == null) {
        logger.error("No session!!!!!!!");
        return null;
      }
  
      Object o = sess.getAttribute(errorObjAttrName);
      MessageEmit err = null;
  
      // Ensure it's initialised correctly
      if ((o != null) && (o instanceof ErrorEmitSvlt)) {
        if (noActionErrors || (((ErrorEmitSvlt)o).getErrors() != null)) {
          err = (MessageEmit)o;
        }
      }
  
      if (err == null) {
        err = new ErrorEmitSvlt();
      }
  
      ActionErrors ae = null;
      if (!noActionErrors) {
        ae = new ActionErrors();
      }
  
      ((ErrorEmitSvlt)err).reinit(id, caller, messages, ae, errProp, clear);
  
      // Implant in session
  
      sess.setAttribute(errorObjAttrName, err);
  
      return err;
    }
docs: Get the error object. If we haven't already got one and
  getErrorObjAttrName 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 errorObjAttrName  name of session attribute
  @param errProp  name of exception message property
  @param noActionErrors true/false
  @param clear list
  @return MessageEmit null on failure