springmvc参数传递不给参数值默认值设置方法

发布时间 2023-04-11 21:49:45作者: 红茶老买到差的

@RequestMapping("hello")

public voiid test001(@RequestParam(defaultValue = "11") int age, @RequestParam(defaultValue = "0.1") double money){

System.out.println("age:" + age + ",money:" + money);

}

 

注意:

 

 默认值 不加 ""  报错