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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.