Java Reference
In-Depth Information
The Duke's Shipment Project
Duke's Shipment is a web application with a login page, a main Facelets page, and some
other objects. This application, which is accessible only to administrators, calls the Order
Service (the RESTful web service exposed by Duke's Store) and lists all orders under
two status headings: Pending and Shipped. The administrator can either approve or deny a
pending order. If approved, the order is shipped, and it appears under the Shipped heading.
If denied, the order disappears from the page, and on the customer's Orders list it appears
as cancelled.
There is also a gear icon on the Pending list that makes an Ajax call to the Order Service
to refresh the list without refreshing the page. The code looks like this:
Click here to view code image
<h:commandLink>
<h:graphicImage library="img" title="Check for new orders"
style="border:0px" name="refresh.png"/>
<f:ajax execute="refresh" render="out" />
</h:commandLink>
Enterprise Bean Used in Duke's Shipment
The enterprise bean used in Duke's Shipment, UserBean , provides the business logic for
the application and is located in the com.forest.shipment.session package. It
is a stateless session bean.
Like Duke's Store, Duke's Shipment uses the AbstractFacade class. This class is
not an enterprise bean but an abstract class that implements common operations for
Type<T> , where <T> is a JPA entity.
Facelets Files Used in Duke's Shipment
Duke's Shipment has only one page, so it has many fewer Facelets files than Duke's Store.
Search WWH ::




Custom Search