Since Spring has deprecated DefaultAnnotationHandlerMapping
and has been replaced by RequestMappingHandlerMapping
, I'm stuck with a case where I had code like below:
@Autowired
private DefaultAnnotationHandlerMapping handlerMapping;
//in an API that lists handler mapping
Map<String, Object> handlerMap = handlerMapping.getHandlerMap();
Now, RequestMappingHandlerMapping
doesn't provide this method. Which function can I use to get the desired handler map?
Things to consider while answering:
- I have limited knowledge about how handler mapping works basically limited to what is explained here.
Things I have been looking at:
I tried to go through the parent classes for both
DefaultAnnotationHandlerMapping
&RequestMappingHandlerMapping
. I reached the conclusion thatAbstractUrlHandlerMapping
is the function that containsgetHandlerMap()
and extendsAbstractHandlerMapping
.RequestMappingHandlerMapping
hasAbstractHandlerMethodMapping<T>
as a super parent and extendsAbstractHandlerMapping
but I couldn't find something similar togetHandlerMap()