From the course: Spring: Spring MVC

Unlock the full course today

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

Basic annotations for controllers

Basic annotations for controllers

From the course: Spring: Spring MVC

Start my 1-month free trial

Basic annotations for controllers

- [Instructor] Now that we have created a basic Spring MVC project using Spring Boot, let us deep-dive into the Controllers concept for Spring MVC. Now we already know that Controllers is basically the C component of Spring MVC and in order that it gets designated as a Controller you have to annotate its class with @Controller annotation. We have already done this inside the home Controller before. There are few Controller specific annotations and objects that we definitely need to know of before we start implementing the use cases for the HPlus application so that when we implement them it'll be comfortable for us. The first one in that list is @RequestParam. This annotation is primarily to make sure that you receive the request parameters from the incoming HTTP request inside your Controller. So if you attach this annotation at your method argument then you will be able to extract those values. The next one is Model or ModelMap.…

Contents