Restful之参数获取 , In 程序 , Views: 767 , Comments: 0 , Index: 3948 , 20 October 2012

先来看@QueryParam :

Path("/users")
public class UserService { 
	@GET
	@Path("/query")
	public Response getUsers(
		@QueryParam("from") int from,
		@QueryParam("to") int to,
		@QueryParam("orderBy") List<String> orderBy) {
 
		return Response
		   .status(200)
		   .entity("getUsers is called, from : " + from + ", to : " + to
			+ ", orderBy" + orderBy.toString()).build();
 
	} 
}