Mini Project: MVC Extension Points: Argument Resolver and Response Envelope
Learn Mini Project: MVC Extension Points: Argument Resolver and Response Envelope (Spring MVC Architecture & Design Patterns, Spring MVC) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.
Mini Real-Time Project: MVC Extension Points: Argument Resolver and Response Envelope Problem Every controller method needs the logged-in user and every API answer should be wrapped in the same JSON envelope {data, meta}. Doing that in each method repeats code; two Spring MVC extension points do it once. Requirements Write a HandlerMethodArgumentResolver that injects the current user into any parameter annotated @CurrentUser. Write a ResponseBodyAdvice that wraps every JSON response in an envelope. Keep the controller methods free of both concerns. Show that errors and non-JSON responses are...