index方法的疑惑,是因为路径根目录“/”的原因吗
Topic sourceMap.of()方法的定义:
/**
* Returns an unmodifiable map containing a single mapping. See Unmodifiable Maps for details.
* Params: k1 – the mapping's key
v1 – the mapping's value
* Returns: a Map containing the specified mapping
* Throws: NullPointerException – if the key or the value is null
* Since: 9
*/
static <K, V> Map<K, V> of(K k1, V v1) {
return new ImmutableCollections.Map1<>(k1, v1);
}
- 1
Best of Me
不太理解控制器首页index方法,为什么要创建实例HashMap<>再传入参数,其他方法可以直接用Map.of方法