code: public static void setRequestAttribute (@Nonnull final ServletRequest aRequest,
                                            @Nonnull final String sAttrName,
                                            @Nullable final Object aAttrValue)
    {
      try
      {
        aRequest.setAttribute (sAttrName, aAttrValue);
      }
      catch (final Exception ex)
      {
        // Happens in certain Tomcat versions (e.g. 7.0.42 with JDK 8):
        if (isLogExceptions ())
          if (LOGGER.isWarnEnabled ())
            LOGGER.warn ("[ServletHelper] Failed to set attribute '" + sAttrName + "' in HTTP request", ex);
      }
    }
docs: Safe version of <code>ServletRequest.setAttribute (String, Object)</code> to
  work around an error in certain Tomcat versions.
  
  <pre>
  java.lang.NullPointerException
  1.: org.apache.catalina.connector.Request.notifyAttributeAssigned(Request.java:1493)
  2.: org.apache.catalina.connector.Request.setAttribute(Request.java:1483)
  3.: org.apache.catalina.connector.RequestFacade.setAttribute(RequestFacade.java:539)
  </pre>
  
  @param aRequest
  Servlet request. May not be <code>null</code>.
  @param sAttrName
  Attribute name. May not be <code>null</code>.
  @param aAttrValue
  Attribute value. May be <code>null</code>.