Org.springframework.web.bind.annotation.RequestParam
lastmod 2026-11-10created 2015-04-253 edits
@RequestParam is an annotation that binds HTTP request parameter values (query string or form data) to the parameters of a Spring MVC controller method. You specify the parameter name with name and whether it is required and its default value with required and defaultValue, and it automatically converts the string to the method parameter's type. Its role differs from @RequestBody, which receives the entire request body as an object, and @PathVariable, which receives URL path variables.