是的,你可以使用params元素:
@RequestMapping("/test.html", params = "day=monday") public void writeMonday() { } @RequestMapping("/test.html", params = "day=tuesday") public void writeTuesday() { }
你甚至可以在地图基础上,存在或不存在一个特性参数的:
@RequestMapping("/test.html", params = "day") public void writeSomeDay() { } @RequestMapping("/test.html", params = "!day") public void writeNoDay() { }
或者你可以这样做:
@RequestMapping("/test.html") public void writeSomeDay(@RequestParam String day) { // code to handle "day" comes here... }