我正在发送以下请求:
GET http://127.0.0.1:8080/ajax/rest/teamService/list HTTP/1.1
Host: 127.0.0.1:8080
Connection: keep-alive
Accept: application/json, text/javascript, */*; q=0.01
X-Requested-With: XMLHttpRequest
User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.64 Safari/537.31
Referer: http://127.0.0.1:8080/do/controlpanel
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Cookie: JSESSIONID=MMezuISPiL9aOEvxmoOKbUWI.undefined
我的 spring 服务 xml 将 /ajax 映射到控制器。此映射应响应:
@RequestMapping(value = "/rest/*")
public @ResponseBody JSONResponse team(@ModelAttribute("cpSession") ControlPanelSession sess, Model model, HttpServletRequest request) {
...
}
同一控制器中的其他映射可以很好地应答 /ajax 调用。例如:
@RequestMapping(value = "/isFNameOK", method = RequestMethod.GET)
@ResponseBody
public String isFNameOK(@ModelAttribute("cpSession") ControlPanelSession sess, Model model, HttpServletRequest request, @RequestParam("fName") String fName) {
...
}
但显然不是,因为我得到:
No mapping found for HTTP request with URI [/ajax/rest/teamService/list]
有任何想法吗?