Reputation: 45
I am currently working on a project where one @GetMapping is making use of ;and +. Given below is the controller class code.
@RestController @Produces(MediaType.APPLICATION_JSON)
@RequestMapping("/v1")
public class RestServiceController {
@GetMapping(path = "/{Id};{Time:.+}")
public ResponseEntity<Request> getSRequestById(@PathVariable String Id, @PathVariable String Time) {
}
}
When I am Hitting the URL http://localhost:8080/v1/123. I am getting below warning org.springframework.web.servlet.PageNotFound - No mapping for GET /v1/123
Upvotes: 0
Views: 269
Reputation: 24630
The mapping contains a regular expression (RE) .+
, that means at least one character. The ;
is a literal to separate the id from time.
Valid URL: /1108;11722222422, /AG8;TIME
Not valid URL: /123, /8;
Anyway, as long @PathVariable is mandatory (required=true by default) the RE is needless.
Upvotes: 4