1.
@RequestMapping("/")
@Controller("AlipayController")
@Autowired
@RequestMapping(value = "replayAlipaySubmit", method = RequestMethod.POST)
public String executeReplayAlipaySubmit(Model model, HttpSession session, @Valid @ModelAttribute("alipayForm") AlipayForm alipayForm, BindingResult results, Device device) throws SQLException {
GoodsForm goodsForm = new GoodsForm();
goodsForm.setType("粮食");
model.addAttribute("goodsForm", goodsForm);
//新建一个goodForm将Type的值设置为粮食
log.info("重新向支付宝发起支付请求。");
//
if (device.isNormal()) {
model.addAttribute("sHtmlText", alipayRequestWeb(alipayForm));
} else {
model.addAttribute("sHtmlText", alipayRequestMobile(alipayForm));
}
//判断是PC端访问还是手机端访问
return "manager/charge/alipay";
//返回的页面
}
@RequestMapping(value = "initDistributorAlipayComfirm", method = RequestMethod.GET)
public String initDistributorAlipayComfirm(Model model, HttpSession session,AlipayForm alipayForm)
{
List<CartForm> cartList = new ArrayList<>();model.addAttribute("cartList", cartList);
//新建一个购物列表让值为空
GoodsForm goodsForm=new GoodsForm();
goodsForm.setType("粮食");
model.addAttribute("goodsForm", goodsForm);
log.info("由分销商直接推荐的商品销售页面初始化。");
//在编程更容易找到位置
UVO uvo= new UVO();
session.setAttribute("UVO",uvo);
//新建一个如同userBean的文件,使得值为空
model.addAttribute("alipayForm", alipayService.searchAlipay(alipayForm));
//alipayForm是AlipayForm的实例,用来提示判断是否有要输入的值为空
return "mobile/alipay/distributorAlipayConfirm";
//要返回的页面
}
2.实现对要输入的框是否为空,如果为空要提示什么值不为空
html: