static void parseWebResources()

in web/src/main/java/org/apache/commons/chain2/web/ChainResources.java [95:123]


    static void parseWebResources(ServletContext context,
                                  String resources,
                                  XmlConfigParser parser) {
        if (resources == null) {
            return;
        }
        Log log = LogFactory.getLog(ChainResources.class);
        String[] paths = getResourcePaths(resources);
        String path = null;
        try {
            for (String path1 : paths) {
                path = path1;
                URL url = context.getResource(path);
                if (url == null) {
                    throw new IllegalStateException
                            ("Missing chain config resource '" + path + "'");
                }
                if (log.isDebugEnabled()) {
                    log.debug("Loading chain config resource '" + path + "'");
                }
                @SuppressWarnings("unused") // FIXME we have to assign the factory here to help the compiler with the type arguments
                CatalogFactory<Object, Object, Map<Object, Object>> factory = parser.parse(url);
            }
        } catch (Exception e) {
            throw new RuntimeException
                ("Exception parsing chain config resource '" + path + "': "
                 + e.getMessage());
        }
    }