Spring MVC controller带参数跳转

/**
     * 去支付界面
* * @param request * @param response */
@RequestMapping(value = "toPay") public String toPay(HttpServletRequest request, HttpServletResponse response) { Dto inDto = Dtos.newDto(request); Map modelMap = (Map)RequestContextUtils.getInputFlashMap(request); System.out.println(modelMap); return "order/buyer/pay.jsp"; } /** * 一个商品产生一个订单
* * @param request * [地址id+(商品id+数量)] * @param response * @return */
@RequestMapping(value = "submitOrder") public String submitOrder(HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) { Dto inDto = Dtos.newDto(request); UserInfoVO userInfo = inDto.getUserInfo(); String user_id_ = null; if (AOSUtils.isEmpty(userInfo)) { user_id_ = "1"; } else {// TODO 测试完删掉 user_id_ = userInfo.getId_(); } Date now = new Date(); String address_id_ = inDto.getString("address_id_"); if (AOSUtils.isNotEmpty(address_id_)) { Common_addressPO addressPO = addressMapper.selectByKey(address_id_); address_id_ = AOSId.uuid(); addressPO.setId_(address_id_); addressPO.setIs_snapnot_(AOSCons.YES); addressPO.setCreate_time_(now); addressPO.setTs_(now); addressMapper.insert(addressPO); } List ware_orders_ = AOSJson.fromJson(inDto.getString("ware_orders_")); List orders = new ArrayList<>(); redirectAttributes.addFlashAttribute("orders", orders); // 转到toPay接口 return "redirect:toPay.jhtml"; }

你可能感兴趣的:(Spring)