js里ajax中的url报错 不进controller 已解决

错误记录4:

在写ajax异步请求的时候 js里ajax中的url总是提示Uncaught SyntaxError: Invalid or unexpected token
LiveEdit compile failed: Uncaught SyntaxError: Invalid or unexpected token 报红  不进controller 找不到进controller的路径

Controller 里加上 method= RequestMethod.POST
 @RequestMapping(value = "/getlist.do",method= RequestMethod.POST)
之前ajax里的路径是:url:path+"/role/getrolelist",//请求的url(但是之前的项目这样写就可以 这次就报错了)
这次要改成
url:"http://localhost:8080/StuManger_war_exploded/stu/getlist.do"
(运行的项目名路径/controller路径名/请求的方法的路径名)

百度了许多办法 都没解决 虽然没想明白为啥这样  还是要记录一下

原创文章 13 获赞 28 访问量 1792

猜你喜欢

转载自blog.csdn.net/ting0712/article/details/103425608