In this section, we will see how to create a JMS application using JSF and Component Dependency Injection (CDI) beans. With CDI beans, we can reduce the code that we wrote using JMS APIs, because we can use annotations to inject objects such as the JMS connection factory, queue, and topic. Once we obtain references to these objects, the steps to send or receive data are the same as those discussed in the previous section. Therefore, our examples in this section do not list the entire code. For the complete source code, download the source code for this chapter.
To prepare our project for using JSF, we need to create web.xml and add the JSF servlet definition and mapping in it. Right-click on the project and select the Java EE Tools | Generate Deployment Descriptor Stub option. This creates web.xml in the ...