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.

Getting ready

The steps to use deployment descriptors include:

  1. Adding an ejb-jar.xml file to your application
  2. Using the<interceptors> element to define ...

Get EJB 3.1 Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.