From the course: Spring Boot 2.0 Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Solution: Generate an MVC webpage

Solution: Generate an MVC webpage

From the course: Spring Boot 2.0 Essential Training

Start my 1-month free trial

Solution: Generate an MVC webpage

(bright music) - [Instructor] I will now offer my solution to this challenge exercise. So the first thing I did was I actually mixed it up just a little bit. So I created a class called room service. Room service actually handled that iteration and data and it returns a method. Now I did this because I wanted to future proof this application for what's coming up next. In a similar fashion, I created a staff service, and this staff service does the same thing. It's got an array of elements, and then it has a get all method that returns that static data. Again, later on, that will be tied to a web service. Now, of course, I added a staff member model and I enumerated the position and I did that to match the database and we'll show you how to do that later on, but you'll see, I have it in enumeration on position. After I did that, I created a controller and the controller gets an instance of that service and returns…

Contents