spring mvc controller可以用Map接收jsp传来的值么
1个回答
展开全部
可以的,如下项目中的例子:
/**
* 跳转到徙木贷款记账复核
* @param model
* @param params
* @param request
* @param response
* @return
*/
@RequestMapping("/loanVerRecordEdit.htm")
public String toLoanVerRecordEdit(Model model,@RequestParam Map<String, Object> params, HttpServletRequest request,
HttpServletResponse response){
logger.info(">>>跳转到徙木贷款记账复核");
String type = params.get("type").toString();
try {
Long id = Long.parseLong(params.get("id").toString());
String loanNo = params.get("loanNo").toString();
CustomerInfoRequest param = new CustomerInfoRequest();
param.setLoanNo(loanNo);
Map<String, Object> map = customerInfoService.queryLoanIouDetail(param);
// 1.借据详情信息
IolDetail iolDetail = (IolDetail) map.get("iolDetail");
//还款信息
LoanVerRecordResponse result = loanVerRecordService.getLoanDetailById(id);
if (result == null) {
result = new LoanVerRecordResponse();
result.setReturnDate(new Date());
}
if (result.getReturnDate() == null) {
result.setReturnDate(new Date());
}
model.addAttribute("iolDetail", iolDetail);
model.addAttribute("loanVerRecord", result);
} catch (Exception e) {
logger.error("跳转到徙木贷款记账复核错误:" + e);
}
if ("1".equals(type)) {
return "loan_ver_record/loanVerRecord_edit";
} else {
return "loan_ver_record/loanVerRecord_detail";
}
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询