code: protected void saveMessages( HttpServletRequest request, ActionMessages messages )
      {
  
          // Remove any messages attribute if none are required
          if ( messages == null || messages.isEmpty() )
          {
              request.removeAttribute( Globals.MESSAGE_KEY );
              return;
          }
  
          // Save the messages we need
          request.setAttribute( Globals.MESSAGE_KEY, messages );
  
      }
docs: Save the specified messages keys into the appropriate request
  attribute for use by the Struts &lt;html:messages&gt; tag (if
  messages="true" is set), if any messages are required.  Otherwise,
  ensure that the request attribute is not created.
  Formerly deprecated: This method will be removed without replacement in a future release.
  
  @param request  The servlet request we are processing
  @param messages Messages object