关于form表单提交的神坑问题

jsp

<form action="../account/accountListOne.do" method="get">
<a href="#" onclick="pageAccount(${i})">${i}</a>
function pageAccount(num) {
    var url = "../account/accountPage.do?currentPage="+num;
    console.log("dsdasdaaddds")
    console.log(num)
    $("form").attr("action",url);
    $("form").submit();
}

comtroller

@RequestMapping("/accountPage.do")
public String account22(@RequestParam("currentPage")int currentPage ,AccountPage account, Model model) {
    System.out.println("起始位置"+account);
    account.setCurrentPage(currentPage);
    AccountPage accountPage = accountService.queryPageAccount(account);
    model.addAttribute("accountPage", accountPage);

    System.out.println("是否大飒飒是法师法");
    System.out.println(accountPage);
    return "account/account_list";
}

在前端点击事件后 提示下面的错误,本以为是类型错误 谁知把from表单的提交方式改为post就好

Required int parameter 'currentPage' is not present

猜你喜欢

转载自blog.csdn.net/lovefamilyc/article/details/81122255