@PathVariable: 路徑中的變數 /user/{userId} userId為PathVariable,1,2,3,...
如@RequestParam: ?後接的那一串 name=aa為RequestParam
如/oo/xx?name=aa,
@RequestMapping(value="/user/{userId}/invoices", method = RequestMethod.GET) public ListlistUsersInvoices( @PathVariable("userId") int user, @RequestParam(value = "date", required = false) Date dateOrNull) { ... }
參考:http://stackoverflow.com/questions/13715811/requestparam-vs-pathvariable
沒有留言:
張貼留言