Skip to main content

Custom Argument Resolver

Learn Custom Argument Resolver (Advanced Spring MVC, Spring MVC) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

Fresher Notes Custom argument resolver is a class that fills a controller method parameter (such as the logged-in user) from the request, so the controller stays free of plumbing code. Steps : write a marker annotation, implement HandlerMethodArgumentResolver , and register it in WebMvcConfigurer.addArgumentResolvers . Result : a method like show(@CurrentUser User u) receives the object directly.

More lessons in Advanced Spring MVC