private static String getClassName( String type, Document webXml, String typeName )
    {
        Log.trace("Looking for class name for {} '{}'", type, typeName);

        String className = null;
        final List<Element> elements = webXml.getRootElement().elements( type ); // all elements of 'type' (filter or servlet).
        for ( final Element element : elements )
        {
            final String name = element.elementTextTrim( type + "-name" );
            if ( typeName.equals( name ) )
            {
                className = element.elementTextTrim( type + "-class" );
                break;
            }
        }

        if (className == null || className.isEmpty() )
        {
            Log.debug("Found no class name for {} '{}'", type, typeName);
            return null;
        }
        else
        {
            Log.debug("Found class name for {} '{}': {}", type, typeName, className);
            return className;
        }
    }
Retrieves the class name for a particular filter from a web.xml document.

Returns 'com.acme.filter.MessageFilter' for 'message' of this web.xml document:
&lt;filter&gt;
  &lt;filter-name&gt;message&lt;/filter-name&gt;
  &lt;filter-class&gt;com.acme.filter.MessageFilter&lt;/filter-class&gt;
&lt;/filter&gt;

@param webXml web.xml document, parsed as XML (cannot be null)
@param filterName The name of the filter (cannot be null or empty).
@return The name of the filter class, or null when no such class was defined.
xmppserver/src/main/java/org/jivesoftware/util/WebXmlUtils.java