code: public static void addFilterMapping(Document doc, Element root) {
      Element filterMapping = doc.createElement("filter-mapping");
      Element filterName = doc.createElement("filter-name");
      filterName.appendChild(doc.createTextNode("ShiroFilter"));
      filterMapping.appendChild(filterName);
      Element urlPattern = doc.createElement("url-pattern");
      urlPattern.appendChild(doc.createTextNode("/*"));
      filterMapping.appendChild(urlPattern);
  
      addDispatchers(doc, filterMapping, "REQUEST", "FORWARD", "INCLUDE", "ERROR");
  
      addRelativeTo(root, filterMapping, "filter-mapping", true);
    }
docs: Adds the filter mapping for the shiro filter to a web.xml file.
  @param doc The xml DOM document to create the new xml elements with.
  @param root The xml Element node to add the filter mapping to.