Loading an XML catalog

An XML catalog will only be used if it has first been loaded. Use a Catalog Loader to load an XML catalog at application startup.

In the following steps you will be creating and/or configuring Spring beans in a Spring context file. A basic knowledge of Spring and the Spring Framework is required.

  1. Open or create a new Spring context file.
  2. Create a Catalog Loader bean.
    1. Select a value for the id attribute that will be unique.
    2. Define a parent attribute with a fixed value of catalog.loader.abstract.
    <bean id="samples.catalog" parent="catalog.loader.abstract">
      <property name="location" value="classpath:/com/componize/samples/01-catalog/catalog.xml" />
    Note: A list of catalog locations (one or more) can be provided on a single Catalog Loader bean.
  3. Restart the application server for your changes to take effect.
The XML catalogs at the given catalog locations will be loaded at application startup and will be used by the Componize ResourceService when resolving URIs. XML catalogs loaded in this way have a global scope and will be used by all users and processes in the application.