private static final Log log = LogFactory.getLog(ContextSpecifiedConfigurationProvider.class);
public PrettyConfig loadConfiguration(ServletContext servletContext)
{
final PrettyConfigBuilder builder = new PrettyConfigBuilder();
PrettyConfigParser configParser = new DigesterPrettyConfigParser();
final List<String> configFilesList = getConfigFilesList(servletContext);
for (final String configFilePath : configFilesList)
{
final InputStream is = servletContext.getResourceAsStream(configFilePath);
if (is == null)
{
log.error("Pretty Faces config resource [" + configFilePath + "] not found.");
continue;
}
log.trace("Reading config [" + configFilePath + "].");
try
{
configParser.parse(builder, is);
}
catch (Exception e)
{
throw new PrettyException("Failed to parse PrettyFaces configuration from " + configFilePath, e);
}