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
From the course: Spring Boot 2.0 Essential Training
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
Understanding Spring Boot dependencies6m
-
(Locked)
Configuring embedded Tomcat5m 6s
-
(Locked)
Employing MVC in Spring Boot2m 1s
-
(Locked)
Thymeleaf templates4m 42s
-
(Locked)
Web application with Spring Boot4m 25s
-
(Locked)
Challenge: Generate an MVC webpage1m
-
(Locked)
Solution: Generate an MVC webpage2m 20s
-
(Locked)
Web services with Spring Boot3m 13s
-
(Locked)
Challenge: Build a web service38s
-
(Locked)
Solution: Build a web service1m 55s
-
-
-
-