public static void addFilter ( Document doc , Element root ) { Element filter = doc . createElement ( "filter" ) ; Element filterName = doc . createElement ( "filter-name" ) ; filterName . appendChild ( doc . createTextNode ( "ShiroFilter" ) ) ; filter . appendChild ( filterName ) ; Element filterClass = doc . createElement ( "filter-class" ) ; filterClass . appendChild ( doc . createTextNode ( "org.apache.shiro.web.servlet.ShiroFilter" ) ) ; filter . appendChild ( filterClass ) ; addRelativeTo ( root , filter , "filter" , true ) ; }
Adds the shiro filter to a web . xml file .