我想将多个参数传递给我的方法.我该怎么做呢?我希望网址看起来像这样的http:// host/one/two/three/four
到目前为止,我有以下代码
@GET
@Produces({MediaType.APPLICATION_JSON})
@Path("/{one,two,three}")
public List<Person> getPeople(@PathParam ("one") String one, @PathParam ("two") String two, @PathParam ("three") String three){
String one = one;
String two = two;
String three = three;
}
Run Code Online (Sandbox Code Playgroud)
这是抓住params并将其传递给我的方法的正确语法吗?我见过@Path中使用的一些正则表达式,但我不明白.老实说,我真的只想抓住参数并尽可能将它们放入变量中.