During this task, you will add the following properties to the DukesBDay bean:
age for getting Duke's age from the web service.
yourBD to hold the user's birth date.
ageDiff to get the age difference from the enterprise bean.
absAgeDiff to hold the absolute value of the age difference.
Right-click in the Editor window, select Insert Code, then Add Property.
Enter age under Name, and set the Type to int, click OK.
Repeat the above steps to create the following properties: yourBD of type java.util.Date, ageDiff of type int, absAgeDiff of type int, and averageAgeDifference of type Double.
After the newly created property fields, add the following Logger instance:
private static Logger logger = Logger.getLogger("firstcup.web.DukesBDay"); |
Initialize the variables in the default constructor:
public DukesBDay() { age = -1; yourBD = null; ageDiff = -1; absAgeDiff = -1; } |
Right-click in the editor and select Format.
Right-click in the editor and select Fix Imports.
Select java.util.logging.Logger for the Logger class, and click OK.