Consider a Spring MVC @RestController
with a @GetMapping
which maps to /v1/**
to handle all sub-paths.
@RestController
public class MyController {
@GetMapping(value = "/v1/**", produces = MediaType.TEXT_HTML_VALUE)
public ModelAndView handle(String fullPathInMethodArg) {
...
String fullPathInLocalVar = ...;
...
}
}
How can I retreive the full path?
Ideally, I want to retrieve it as an argument in the method: String fullPathInMethodArg
.
Alternatively, I want to retrieve it as a local variable: String fullPathInLocalVar
.