From the course: Complete Guide to Spring MVC

Unlock this course with a free trial

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

HandlerFunction: ServerRequest & ServerResponse

HandlerFunction: ServerRequest & ServerResponse - Spring Tutorial

From the course: Complete Guide to Spring MVC

HandlerFunction: ServerRequest & ServerResponse

- [Instructor] HandlerFunction, ServerRequest, and ServerResponse. When you're in your journey with Spring MVC, understanding how to handle HTP requests is fundamental. And as we've learned up to this point, Spring MVC traditionally uses annotations to define request mappings. However, as of Spring 5+ going into 6 and 7, there's a functional programming model available, which includes, as we've seen in our previous example, your HandlerFunction, your ServerRequest, and ServerResponse. Remember, ServerRequest, as your coffee order from your local cafe, it contains everything about what the customer or client wants. Your ServerRequest is that immutable representation of a HTTP request in Spring's functional programming paradigm. It provides a concise and threat-safe way to access all details about an incoming HTP request. There are two main features of ServerRequests. That is your metadata access, so think your HTTP method. This determines the request type, like Get, Post, et cetera…

Contents