}
webAppContext.addServlet(holder, pathSpec);
if(requireAuth && UserGroupInformation.isSecurityEnabled()) {
ServletHandler handler = webAppContext.getServletHandler();
FilterMapping fmap = new FilterMapping();
fmap.setPathSpec(pathSpec);
if (useKsslForAuth) {
LOG.info("Adding Kerberos (KSSL) filter to " + name);
fmap.setFilterName(KRB5_FILTER);
} else {
LOG.info("Adding Kerberos (SPNEGO) filter to " + name);
fmap.setFilterName(SPNEGO_FILTER);
}
fmap.setDispatches(Handler.ALL);
handler.addFilterMapping(fmap);
}
}