Workbook 2.10
Task 1
Create a POJO class for Employee
objects. The class will have three fields:
private String name; private int age; private String role;
Add the usual constructor, getters, and setters.
Task 2
Before returning the view, add the following objects to the model:
List<Employee> employees = Arrays.asList( new Employee("Jim Halpert", 32, "Salesman"), new Employee("Andy Bernard", 38, "Salesman"), new Employee("Pam Beesly", 32, "Receptionist"), new Employee("Michael Scott", 49, "Regional Manager"), new Employee("Ryan Howard", 28, "Temp"), new Employee("Angela Martin", 35, "Accountant"), new Employee("Dwight Schrute", 37, "Assistant to the Regional Manager") );
Task 3
Under the header in staff.html
, create a table similar to the following:
Name | Age | Role |
---|---|---|
Data | Data | Data |
Data | Data | Data |
Data | Data | Data |
Task 4
Using a Thymeleaf loop, your table must generate as many rows as there are objects in the employees
list.
Expected Output:
Good Luck!
Feedback Summary
5.0
4 students
5
100%
4
0%
3
0%
2
0%
1
0%
Written Reviews
There are no written reviews yet.