springMVC接收从jsp页面传递的参数想在原有页面上显示结果
jsp页面代码:<inputtype="button"onclick="next();"value="下一页"/>functionnext(){window.open("...
jsp页面代码:
<input type="button" onclick="next();" value="下一页"/>
function next(){
window.open("${ctx}/list.do?page="+document.getElementById("page").value) ;
}
后台代码:
@RequestMapping("/list")
public String listStudent(HttpServletRequest request,Model model){
int pageSize=5;//每页显示多少记录
int page = request.getParameter("page") == null ? 1 : Integer.valueOf(request.getParameter("page"));
if(page<1) page=1;
model.addAttribute("page", page);
return "/student/list";
} 展开
<input type="button" onclick="next();" value="下一页"/>
function next(){
window.open("${ctx}/list.do?page="+document.getElementById("page").value) ;
}
后台代码:
@RequestMapping("/list")
public String listStudent(HttpServletRequest request,Model model){
int pageSize=5;//每页显示多少记录
int page = request.getParameter("page") == null ? 1 : Integer.valueOf(request.getParameter("page"));
if(page<1) page=1;
model.addAttribute("page", page);
return "/student/list";
} 展开
若以下回答无法解决问题,邀请你更新回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询