Defining a new link interceptor

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.

To complete the following task, you will need the following beans:
  • A DocumentTypeFilter bean for the applicable document types.
  • A LinkDefinition bean for each of the link types to intercept.
  1. Open or create a new Spring context file.
  2. Create an XLink Interceptor bean.
    <bean id="xhtml.xlink.interceptor" parent="xlink.rdf.interceptor.link.abstract">
      <property name="xmlSchemaFilter" ref="samples.dtd.xhtml" />
      <property name="linkDefinitions">
        <list>
          <ref bean="xhtml.linkDefinition.href" />
          <ref bean="xhtml.linkDefinition.img" />
        </list>
      </property>
    </bean>
  3. Restart the application server for your changes to take effect.