From the course: Spring Boot 3 Essential Training

Unlock this course with a free trial

Join today to access over 24,600 courses taught by industry experts.

Web services with Spring Boot

Web services with Spring Boot

- [Narrator] Since we're working with Web, now's a great time to talk about Web Services with Spring, which is probably the most common use of Spring even more so than building Web Pages. Spring Boot Web Services use an MVC implementation. The pattern is exactly the same as with Web Applications, but in the case of Web Services, the view is the content type of the page, not just HTML. You use REST controller as your annotation instead of controller in order to not map to a view. Instead, the object is returned. In fact, the difference between a standard controller and a REST controller is just that it has a response body, and that response body by default serves JSON. You're not stuck with JSON. You can serve XML if you choose. There is configuration to make that a reality. But in today's world of REST, most of us serve JSON. So we're going to stick with that throughout the rest of this course.

Contents