I have this URL.
http://localhost:9000/api/datos-generales?page=0&size=20&sort=id,asc&filter=7588
and I want to recover the value of the last parameter. “filter”.
this is the signature of the method in the backend.
@GetMapping("")
public ResponseEntity<List<DatosGeneralesDTO>> getAllDatosGenerales(
@org.springdoc.core.annotations.ParameterObject Pageable pageable,
// @RequestAttribute(name = "filter", required = false, value = "") String filter,
@RequestParam(name = "filter", defaultValue = "", required = false) String filter
) {
//SOME CODE
log.debug('FILTER:", filter);
}
I’ve tried with RequestAttribute, RequestParam even with RequestBody but none of them can get the value in the param.
what is the right way?
1