Front slash(/) and special characters in rest url

324 views Asked by At

Restful web services : GetMapping url has a variable which should be passed as a path variable but that variable contains front slash and special characters in it. Any suggestions on how to handle that in springboot.

@GetMapping(value = “/test/{id}”)
Public TestClass getData(@PathVariable(“id”)){
   return testService.getDataService(id);
}

Here the Path variable “id” value is “00/01*1”

1

There are 1 answers

1
NXML On

Look a this [https://www.baeldung.com/spring-slash-character-in-url][1], Maybe use the @RequestParam("param") annotation for your request handler