1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| @Controller @RequestMapping("/alpha") public class AlphaController{ @RequestMapping(path = "/students", method = RequestMethod.GET) @ResponseBody public String getStudents( @RequestParam(name="current", required = false, defaultValue = "1") int current, @RequestParam(name="limit", required = false, defaultValue = "10") int limit){
System.out.println(current); System.out.println(limit); return "some students"; } @RequestMapping(path = "/student/{id}", method = RequestMethod.GET) @ResponseBody public String getStudent(@PathVariable("id") int id){ System.out.println(id); return "a student"; } }
|