January 2018
Intermediate to advanced
414 pages
10h 29m
English
In RequestMapping, we do not define parameters using the URL as we did in path variables. We declared them as parameters in our functions and annotated with the @RequestParam annotation. In the annotation, we can specify if the parameter is a required parameter, and if it has a default value, so if it is not present, that value will get injected in our mapping method.
The default value must always be a string, and Spring will convert it back to any other type automatically. We can define as many parameters as we like, and they will be separated with and in the URL. With this last addition, we can start to create more flexible APIs that will handle those parameters to tweak our functionality.
Read now
Unlock full access