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.
After the dukesBirthday variable declaration, add the following private variables:
private int age; private Date yourBD; private int ageDiff; private int absAgeDiff; private static Logger logger = Logger.getLogger("firstcup.web.DukesBDay"); |
Initialize the variables by adding a 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.Date for the Date class, java.util.logging.Logger for the Logger class, and click OK.