Quantcast
Channel: Active questions tagged rest - Stack Overflow
Viewing all articles
Browse latest Browse all 4115

in spring web, get parameter from URL

$
0
0

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.

@RestController@RequestMapping("/api/datos-generales")public class DatosGeneralesResource {   @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);//Here the output is "FILTER:" but the value is not logged.}}

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?


Viewing all articles
Browse latest Browse all 4115

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>