在做ssm练习时发生了这种问题,html中的post请求路径正确,controller中的RequestMapping地址也正确,结果跳转的时候却跳错误的地址
html代码:
$.post("/ssm/notice/listnotice", app.queryInfo ,function(backData){
app.tableData = backData.data.currentData;
app.t = backData.data.totalCount;
$.get("/ssm/goods/querystate" ,function (backData) {
app.stateArr = backData.data;
});
});
controller代码:
@Controller
@RequestMapping("notice")
public class NoticeController {
@Autowired
private NoticeService noticeService;
@RequestMapping("listnotice")
public AjaxResult list(NoticeQuery noticeQuery){
return noticeService.listNotice(noticeQuery);
}
}
Type Status Report
Message /ssm/notice/notice/listnotice
Description The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.
为什么会自动再插入一个/notice呢?
并且如果html对应的RequestMapping的地址不存在,报的就是正常的404 Message /ssm/notice/list
这个地方的消息头甚至都是正常的