To see these concepts in action, and to gain an understanding of how Seam components are used instead of JSF backing beans, let us look at a simple calculator web application. This simple application allows us to enter two numbers on a web page. Clicking the Add button on the web page will cause the sum of the numbers to be displayed.
This basic application will give us an understanding of the layout of a Seam application and how we can inject and outject components between the business layer and the view. The application functionality is shown in the following screenshot.
Note
The sample code for this application can be downloaded from the Packt web site, at http://www.packtpub.com/support.
For this sample application, we have a single JSF page that is responsible for:
Reading two numeric values from the user
Invoking business logic to add the numbers together
Displaying the results of adding the numbers together
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" ...