Spring AOP: How to read path variable value from URI template in aspect?
I want to create Spring aspect which would set method parameter, annotated by custom annotation, to an instance of a particular class identified by an id from URI template. Path variable name is parameter of the annotation. Very similar to what Spring @PathVariable does. So that controller method would look like: @RestController @RequestMapping("/testController") public class TestController { @RequestMapping(value = "/order/{orderId}/delete", method = RequestMethod.GET) public ResponseEntity<?> doSomething( @GetOrder("orderId") Order order) { // do something with order } } Instead of classic: