June 2018
Intermediate to advanced
596 pages
12h 39m
English
We have seen how to use the @RequestMapping annotation to map the incoming request to a Controller method. So far, we have mapped static URL patterns in @RequestMapping. However, it is possible to map parameterized URLs (like those used in REST; see https://spring.io/understanding/REST) using @RequestMapping. The parameters are specified inside {}.
Let's add the feature to update an existing course. Here, we will only discuss how to code the Controller method for this feature. The complete code is available when you download the samples for this chapter.
Let's add the following method in CourseController:
@RequestMapping("/course/update/{id}") public String updateCourse (@PathVariable int id, Model model) ...Read now
Unlock full access