首页 试题广场 > 试题详情
多选题

【C016002】在SpringMVC中,SpringMVC使用@PathVariable 注解接收基本类型的数据,代码如下:
@RequestMapping("/{reqKey}/req.do")
@ResponseBody
public ResponseEntity<String> ordersBack(
@PathVariable String reqKey,
@RequestParam(value="intVal") int intVal,
@RequestParam(value="strVal") String strVal) throws Exception{
return new ResponseEntity("ok", HttpStatus.OK);
}
需要改动( )代码才能正常工作。

  • A.给@RequestParam增加required=false?属性
  • B.修改@RequestParam(value="intVal") int intVal 为
    @RequestParam(value="intVal") Integer intVal
  • C.@RequestParam(value="intVal") int intVal使用defaultValue
  • D.@ResponseBody
    删除此注释
提交并查看答案
下一题 上一题
Ke星伙伴们的回答/ 8个回答
贡献榜
相关试题
关闭
关闭
QQ
交流群
邀请
好友
App
下载
意见
反馈
返回
顶部