2. Understanding Java Platform, Enterprise Edition
3. Creating Your First Java EE Application
4. Creating Your Second Web Application
Create the Web Application Project
Creating the Java Persistence API Entity
Create the FirstcupUser Entity Class
Add Properties to the FirstcupUser Entity
Add Constructors to the FirstcupUser Entity
Add a Named Query to the FirstcupUser Entity
Create the DukesBirthdayBean Enterprise Bean Class
Add a Logger Instance to DukesBirthdayBean.java
Add a Business Method to DukesBirthdayBean that Gets the Average Age Difference of firstcup Users
Add a Business Method for Calculating the Age Difference Between Duke and the User
Configuring the Resource Bundle in the Configuration File
Creating the DukesBDay Managed Bean Class
Add an Enterprise Bean Reference
Get the Age Difference from the DukesBirthdayBean Enterprise Bean
Resource Libraries in firstcup
The inputDate Composite Component
Create the inputDate Composite Component
Set the Welcome File in the web.xml Deployment Descriptor
Add the Form to greeting.xhtml
Building, Packaging, Deploying, and Running the firstcup Web Application
In this section, you will build the firstcup web application, deploy it to the server, and run the application.
While performing this task, you'll build and package the DukesBirthdayBean enterprise bean, the FirstcupUser entity, and the firstcup web client into a WAR file, firstcup.war, in the dist directory, then deploy it to the server.
This section describes how to run the firstcup application.
http://localhost:8080/firstcup/
Example 4-1 A Successful Response Page for firstcup
You are 20 years older than Duke! The average age difference of all First Cup users is 20.0.
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Legal Notices
Scripting on this page tracks web page traffic, but does not change the content in any way.