processorClazz = loadClass(processorClass);
} catch (Exception e) {
throw new FacesException(e);
}
try {
Mapping mapping = (Mapping) clazz.newInstance();
mapping.setMappings(mappings);
mapping.setMechanism(mechanism);
mapping.setPattern(pattern);
Processor processor = (Processor) processorClazz.newInstance();
if (processor instanceof FilteringProcessor) {
String excludesPatterns =
context.getExternalContext().getInitParameter(excludesName);
if (excludesPatterns == null) {
excludesPatterns = excludesDefault;
}
((FilteringProcessor) processor).setExcludes(excludesPatterns);
String includesPatterns =
context.getExternalContext().getInitParameter(includesName);
if (includesPatterns == null) {
includesPatterns = includesDefault;
}
((FilteringProcessor) processor).setIncludes(includesPatterns);
}
mapping.setProcessor(processor);
mappings.addMapping(mapping);
} catch (RuntimeException e) {
throw e;
} catch (Exception e) {
throw new FacesException(e);