我需要帮助我的Spring Restful Service Script。我试图在帖子体中设置默认值,我需要知道这可能吗?或不?
关于需要默认值的登录。
它与获取功能一起使用以下代码:
@ResponseBody
@RequestMapping(value= {"login/"},
method = {RequestMethod.GET, RequestMethod.POST},
consumes = {MediaType.TEXT_PLAIN_VALUE },
produces = {MediaType.APPLICATION_JSON_VALUE}
public String login(@RequestParam(value= "user", defaultValue = "") String user,
@RequestParam(value ="password", defaultValue = "") String password)
{
System.out.println(user+"---"+password);
}
但数据非常明智,所以我需要发布它们。