Using deployment descriptors for interceptors
To specify interceptor methods of an interceptor class, we use the
<interceptors> element with other elements in the
ejb-jar.xml file. In this recipe, we examine how this is done. Interceptors are discussed in more detail in Chapter 8,
Java EE 6 application no longer requires deployment descriptors as annotations have largely taken their place. However, there are certain situations where they are still needed. One of these situations is when we want to use a default interceptor as detailed in the Using deployment descriptors for default interceptors recipe.
The steps to use deployment descriptors include:
- Adding an
ejb-jar.xmlfile to your application
- Using the
<interceptors>element to define ...