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

@RequestMapping("hello")

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

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

}

 

注意:

 

 默认值 不加 ""  报错  

posted @ 2023-04-11 21:41  红茶老买到差的  阅读(166)  评论(0)    收藏  举报