@RequestParam如何接受参数的值为空null

2019-05-08 14:18:00
admin
原创
17365
摘要:@RequestParam如何接受参数的值为空null

@RequestParam如何接受参数的值为空null,

如果你是这样写的

@RequestParam(value = "deliveryType") String deliveryType,

会出现如下错误:Required String parameter 'paramter' is not present

所以你需要加入:required = false,下面就不会出现错误了

@RequestParam(value = "deliveryType",required = false) String deliveryType,


发表评论
评论通过审核之后才会显示。
文章分类
联系方式
联系人: 郑州-小万
电话: 13803993919
Email: 1027060531@qq.com
QQ: 1027060531
网址: www.wanhejia.com