纠正你2点错误
1,既然前端ajax的type: "POST",那就请不要设置async: false,不然POST的意义何在?(当然这不是出错的主要原因,仅作为提醒)
2,后端SpringMvc方法的参数绑定,你这么个写法一定要加上required = false。如下:
@Controller
@RequestMapping("/ceshi")
public class ceshi {
@RequestMapping("/index")
@ResponseBody
public String index(HttpServletRequest request, HttpSession httpSession,
@RequestParam(value = "page", required = false, defaultValue = "1") int page,
@RequestParam(value = "rows", required = false, defaultValue = "1") int rows,
Map<String,Object> map) {
try {
//TODO ....
} catch (Exception e) {
}
return "hello";
}
}
这样下断点就能进入了,祝你成功
兄弟,你是真的强,不过这个404是真的误导人,我总把问题归结到是路径上,多谢