Message-driven bean clients

We implement two clients that have very similar code:

  • Servlet client (for testing)

  • J2EE application client (for deployment)

Servlet client

The servlet client is easier to configure because we already have a Web project in the enterprise application:

  • In the ItsoBank5Web project create a package: itso.bank5.mdb.servlet.
  • Create a servlet named MdbTester in the new package. Select to have only a doGet method generated.
  • Complete the code as shown in Example 16-1.
Example 16-1. MDB client servlet (abbreviated)
 package itso.bank5.mdb.servlet; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; ...

Get EJB 2.0 Development with WebSphere Studio Application Developer now with O’Reilly online learning.

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