Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>OK. Seems I find the reason.</p> <p>In HandlerMethodInvoker.java</p> <pre><code>@SuppressWarnings("unchecked") private Object resolveRequestParam(String paramName, boolean required, String defaultValue, MethodParameter methodParam, NativeWebRequest webRequest, Object handlerForInitBinderCall) throws Exception { Class&lt;?&gt; paramType = methodParam.getParameterType(); if (Map.class.isAssignableFrom(paramType)) { return resolveRequestParamMap((Class&lt;? extends Map&gt;) paramType, webRequest); }} private Map resolveRequestParamMap(Class&lt;? extends Map&gt; mapType, NativeWebRequest webRequest) { Map&lt;String, String[]&gt; parameterMap = webRequest.getParameterMap(); if (MultiValueMap.class.isAssignableFrom(mapType)) { MultiValueMap&lt;String, String&gt; result = new LinkedMultiValueMap&lt;String, String&gt;(parameterMap.size()); for (Map.Entry&lt;String, String[]&gt; entry : parameterMap.entrySet()) { for (String value : entry.getValue()) { result.add(entry.getKey(), value); } } return result; } else { Map&lt;String, String&gt; result = new LinkedHashMap&lt;String, String&gt;(parameterMap.size()); for (Map.Entry&lt;String, String[]&gt; entry : parameterMap.entrySet()) { if (entry.getValue().length &gt; 0) { result.put(entry.getKey(), entry.getValue()[0]); } } return result; } } </code></pre> <p>When it checks that if my @RequestParam annotated parameter is Map class type, it puts all request parameters into this parameter as MultiValueMap or Linked HashMap</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload