我想获取 url-param id,但它不起作用。这里每个人都可以帮助我吗?
下面的代码不起作用。
Url:
http://localhost:9000/rest/alerts?ids[]=123?ids[]=456
路由配置文件
GET /restws/alerts{ids} controllers.AlertService.findAlertsForIds(ids: List[String])
AlertService.java
public static Result findAlertsForIds(List<String> ids){
return ok("Coole Sache");
}
这种参数绑定可以与查询字符串参数一起开箱即用。
你的路线必须这样声明:
GET /restws/alerts controllers.AlertService.findAlertsForIds(ids: List[String])
并且您的 URL 应遵循以下模式:
http://localhost:9000/rest/alerts?ids=123&ids=456
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)