Closed mehtakaran9 closed 3 years ago
when java already compiled to binary code, we can not get information about the paramerName, so it's not recommended to get parameter name from parameter field value name, because it will be changed after compiled to binary code
If you use the following:
@RequestParam String requestParamOne
, it will not work because the name of the param is taken by the name or value of the annotationString name = StringUtils.isEmpty(annotation.name()) ? annotation.value() : annotation.name();
Hence, the need for declaring it as follows:@RequestParam("requestParamOne") String requestParamOne
But ideally, it should be taken as the default if empty, from the Parameter's name field (parameter.getName()
)