19.5. Developing an EJB Client
With the bean created and deployed, we need a client in order to test it. Normally, a sophisticated EJB component such as the one we've developed would deserve a nice, meaty client like a JSP/servlet combination. But to keep the code size simple and not introduce any extraneous features, we'll actually go back to our very first example client-the Console class—and modify it to work with our Enterprise JavaBean.
The main difference is in gaining access to the Standings EJB. In the original client, we obtained a reference from the ObjectFactory. For the EJB client, we instead need to look up the bean in the JNDI service.
When we've looked up objects previously in the JNDI or RMI registries, we've simply used the Java ...
Get J2EE™ and JAX™: Developing Web Applications and Web Services 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.