0

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”

João Dias
  • 16,277
  • 6
  • 33
  • 45

1 Answers1

0

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

NXML
  • 16
  • 2
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Dec 25 '22 at 12:01