Spring Boot Bootcamp – Workbooks and Challenges
)}

Workbook 2.10

Screen Shot 2022-08-15 at 11.21.05 PM.png

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:

NameAgeRole
DataDataData
DataDataData
DataDataData

Task 4

Using a Thymeleaf loop, your table must generate as many rows as there are objects in the employees list.

Expected Output:


Screen Shot 2022-05-22 at 5.32.13 PM.png

Good Luck!

Feedback Summary
5.0
3 students
5

100%
4

0%
3

0%
2

0%
1

0%
Written Reviews
There are no written reviews yet.