存在可选的int参数“productCount”,但由于声明为原始类型,不能转换为空值。考虑将其声明为对应基本类型的对象包装器。 @RequestParam使用defaultValue属性设置默认值 @RequestParam(defaultValue = "0")