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
- Custom HandlerMapping
- Custom HandlerAdapter
- Custom ViewResolver
- HandlerMethodArgumentResolver
- Custom Return Value Handler
- HandlerMethodReturnValueHandler
- Custom Formatter
- Custom Converter
- Custom Interceptor
- Custom Exception Resolver
- Custom Message Converter
- Custom Annotation
- Request Lifecycle Customization
- Mini Project: Asynchronous Requests: Callable, DeferredResult and Server-Sent Events