springMVC参数初始化

参见类:HandlerMethodInvoker

Class[] paramTypes = handlerMethod.getParameterTypes();

Object[] args = new Object[paramTypes.length];

 

for (int i = 0; i < args.length; i++) {

MethodParameter methodParam = new MethodParameter(handlerMethod, i);

methodParam.initParameterNameDiscovery(this.parameterNameDiscoverer);

GenericTypeResolver.resolveParameterType(methodParam, handler.getClass());

 

可以看出,先列出参数的所有类型,然后遍历来给这些类型的参数赋值

你可能感兴趣的:(springMVC)