code: protected final void addStateAttribute(AbstractHtmlState state, String name, String value)
              throws JspException {
  
          // validate the name attribute, in the case of an error simply return.
          if(name == null || name.length() <= 0) {
              String s = Bundle.getString("Tags_AttributeNameNotSet");
              throw new JspException(s);
          }
  
          // it's not legal to set the id or name attributes this way
          if(name.equals(HtmlConstants.ID) || name.equals(HtmlConstants.NAME)) {
              String s = Bundle.getString("Tags_AttributeMayNotBeSet", new Object[]{name});
              throw new JspException(s);
          }
  
          // if there is a style or class we will let them override the base
          if(name.equals(HtmlConstants.CLASS)) {
              state.styleClass = value;
              return;
          }
          else if(name.equals(HtmlConstants.STYLE)) {
              state.style = value;
              return;
          }
  
          state.registerAttribute(AbstractHtmlState.ATTR_GENERAL, name, value);
      }
docs: <p>
  Add an HTML state attribute to a {@link AbstractHtmlState} object.  This method performs
  checks on common attributes and sets their values on the state object or throws an exception.
  </p>
  <p>
  For the HTML tags it is not legal to set the <code>id</code> or <code>name</code> attributes.
  In addition, the base tag does
  not allow facets to be set.  If the attribute is legal it will be added to the
  general expression map stored in the <code>AbstractHtmlState</code> of the tag.
  </p>
  
  @param state the state object to which attributes are appliedn
  @param name the name of an attribute
  @param value the value of the attribute
  @throws JspException when an error occurs setting the attribute on the state object