这块代码看的不是太懂,请大神帮忙

坚持的奋斗者 2017-07-02 05:50:09

@RequestMapping("/pro/fwpj/fwpjlst.htm")
public ModelAndView fwpjlst(HttpServletRequest request, @RequestParam(value = "page", required = false, defaultValue = "1") int currentPage,
@RequestParam(value = "sfpj", required = false, defaultValue = "-1") int sfpj) throws Exception {
ProUser proUser = getProUser();
int allnum = fwpjService.getCountByZjhm(proUser.getZjhm(), FwpjConstant.SFPJ_ALL);
int ypjnum = fwpjService.getCountByZjhm(proUser.getZjhm(), FwpjConstant.SFPJ_YPJ);
int wpjnum = allnum - ypjnum;
List<Map<String, Object>> vfwpjLst = fwpjService.getFwpjListByZjhm(proUser.getZjhm(), currentPage, sfpj);
Timestamp date = this.ajService.getStartTime();
request.setAttribute("startDate", date);
request.setAttribute("fwpjLst", vfwpjLst);
if (sfpj == 1) {
request.setAttribute("qnum", ypjnum);
} else if (sfpj == 2) {
request.setAttribute("qnum", wpjnum);
} else {
request.setAttribute("qnum", allnum);
}
request.setAttribute("ypjnum", ypjnum);
request.setAttribute("wpjnum", wpjnum);
request.setAttribute("allnum", allnum);
request.setAttribute("page", currentPage);
request.setAttribute("rows", ZxxxUtils.ROWS);
request.setAttribute("sfpj", sfpj);
return new ModelAndView("/pro/blue/fwpj/fwpjlst");
}

这块代码设置request属性后,没有重定向到另一个jsp页面,反而返回了一个ModelAndView,为什么要这样呢?小白一枚,请大神指教
...全文
103 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

5,655

社区成员

发帖
与我相关
我的任务
社区描述
Web开发应用服务器相关讨论专区
社区管理员
  • 应用服务器社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧