springMVC怎么向前端传输对象,前端又怎么取出
1个回答
展开全部
@RequestMapping({"/blogs/{pageNumber}"})
public String blog(HttpServletRequest request, @PathVariable("pageNumber") String pageNumber, Model model) {
request.setAttribute("pageNumber", pageNumber);
Page page = this.articleService.getAllByPage(request, null);
model.addAttribute("page", page);//放对象
model.addAttribute("articlesNew", this.articleService.getNewArticles(null, Integer.valueOf(8)));
model.addAttribute("articlesClick", this.articleService.getClickArticles(null, Integer.valueOf(5)));
model.addAttribute("headTitles", this.headTitleService.getAll());
return "blog";
}
前端:
${page.pagenum}
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询