Just curious to know in which scenario we should go for @RequestParam
and @PathVariable
. I know that:
@RequestParam
takes parameter value whereas@PathVariable
takes placeholder value@RequestParam
can be optional (required=false) while making request whereas@PathVariable
value has to be provided.- When we want to use
@RequestParam
we have to know the property syntax but for@PathVariable
not required
Is there any other reason to go for specific one?