Sample: Simple Calculator EJB 3.0

This sample implements a basic calculator using an EJB 3.0 session bean. It demonstrates the use of @Stateless() and @Remote annotations, and it shows how to display the result using a Java Server Page.
Time required: 5 minutes
When you import the sample, it will create the appropriate projects for you to explore. For instructions on how to run the application, click the Setup instructions link.

Before importing this sample, make sure that you have installed the IBM® WebSphere® Application Server 7.0, or the IBM WebSphere Application Server 6.1 with the IBM WebSphere Application Server Version 6.1 Feature Pack for EJB 3.0.

After you import the sample, you can explore the project files. The EJB project SimpleCalculatorEJB3 contains a session bean with the calculator methods. The dynamic Web project SimpleCalculatorWeb contains a servlet to store the result of the calculator operations and a JSP to display the results.

When you run the sample, a browser opens in your workspace displaying the interface for the calculator sample:


Feedback