Http Exchange annotations which are the equivalent of MVC mapping annotations, can also be used server-side.
https://docs.spring.io/spring-framework/reference/integration/rest-clients.html#rest-http-service-client
On the server side, an @controller class can implement the same interface to handle requests with @HttpExchange controller methods.
| Spring MVW (org.springframework.web.bind.annotation) |
Spring Http Interface (org.springframework.web.service.annotation) |
@RequestMapping |
@HttpExchange |
@GetMapping |
@GetExchange |
@PostMapping |
@PostExchange |
@PutMapping |
@PutExchange |
@PatchMapping |
@PatchExchange |
@DeleteMapping |
@DeleteExchange |
If you test rest-problem-java you'll notice there is an exception handler missing for org.springframework.web.method.annotation.HandlerMethodValidationException.
Draft HandlerMethodValidationExceptionHandler.java