问题
I was using Spring 4.2.x HandlerMethodSelector class - now migrating to Spring 5.1.x. Can anyone please help? how can we replace the below code in the latest Spring version?
final Set<Method> methods = HandlerMethodSelector.selectMethods(userType, new MethodFilter()
{
@Override
public boolean matches(final Method method)
{
return hasRequestMappingOverrideAnnotation(method);
}
});
回答1:
HandlerMethodSelector replaced with MethodIntrospector
@deprecated as of Spring 4.2.3, in favor of the generalized and refined {@link MethodIntrospector}
You have similar method to use
static Set<Method> selectMethods(Class<?> targetType, ReflectionUtils.MethodFilter methodFilter)
Select methods on the given target type based on a filter.
来源:https://stackoverflow.com/questions/59305290/alternate-of-spring-handlermethodselector-selectmethods