package cn.edu.nuc.shop.controller; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import cn.edu.nuc.shop.entiry.Forder; import cn.edu.nuc.shop.service.interfaces.ForderService; @Controller @RequestMapping("/forder") public class ForderController { @Autowired private ForderService forderMapper; @RequestMapping(value="/order",method=RequestMethod.GET) public String toorder(){ return "redirect:/order.jsp"; } @RequestMapping(value="/order",method=RequestMethod.POST) public String order(Forder forder,HttpSession session,HttpServletRequest request){ Forder sessionforder = (Forder)session.getAttribute("forder"); int count=0; try { count = forderMapper.insertOrder(forder,sessionforder); } catch (Exception e) { request.setAttribute("msg", "商品数量不足"); return "forward:/msg.jsp"; } System.out.println(forder.getFid()); System.out.println(count+"--------------------------"); request.setAttribute("msg", "提交订单成功"); request.removeAttribute("forder"); session.removeAttribute("forder"); return "forward:/msg.jsp"; } }

Xppasdf LV3
2024年10月29日
qiulai LV1
2024年5月30日
fdeded LV1
2024年4月20日
zhufbing LV1
2024年1月29日
yuanchuang LV22
2023年12月28日
微信网友_6680567232876544 LV8
2023年10月10日
SDLFJL LV6
2023年8月17日
微信网友_6436772032335872 LV3
2023年4月17日
2643028272 LV1
2023年3月6日
qwe123456asd LV3
2023年2月3日

阿莫斯 LV1
2月25日
orang801 LV2
2月24日
微信网友_7310057461567488
2024年12月24日
暂无贡献等级
ma406805131 LV19
2024年12月18日
微信网友_6377331253415936 LV3
2024年11月24日
lzhangxiangling
2024年11月11日
暂无贡献等级
jy1111
2024年11月11日
暂无贡献等级
微信网友_7249860635152384
2024年11月11日
暂无贡献等级
Xppasdf LV3
2024年10月29日
krispeng LV14
2024年10月28日