更多信息: https://oldmoon.top/post/191
简介
使用最新版的
Name for argument of type [java.lang.String] not specified, and parameter name information not available via reflection. Ensure that the compiler uses the ‘-parameters’ flag.
官方说明中一直强调
Note that use of
@RequestParam is optional (for example, to set its attributes). By default, any argument that is a simple value type (as determined by BeanUtils#isSimpleProperty) and is not resolved by any other argument resolver, is treated as if it were annotated with@RequestParam .翻译一下大概是:
注意,
@RequestParam 的使用是可选的(例如,设置其属性)。 默认情况下,任何简单值类型(由 BeanUtils#isSimpleProperty 确定)且未由任何其他参数解析器解析的参数都将被视为使用@RequestParam 注解。
根据原文及翻译,这自然让我认为,
然而奇怪的是,当
但如果不使用
更多信息: https://oldmoon.top/post/191