@RequestMapping(value = "createOrder",method = RequestMethod.POST,params={"userName"})
     public ModelAndView createOrder(@RequestParam("userName") String userName) throws ClassNotFoundException, SQLException {                   
                   Map<String,Object> model = new HashMap<String,Object>();
                   MenuDao mdao = new MenuDao();
                   OrderBean orderItem = new OrderBean();
          		   orderItem = mdao.displayCart();
                   System.out.println("Username test in customer controller create order: "+userName);
                   boolean b = false;
                   ArrayList<ItemBean> itemsList = new ArrayList<ItemBean>();
                   String orderNo = mdao.createOrder(userName, orderItem);
                   if(!orderNo.equals(null)) {
                	  itemsList = orderItem.getItemList();
                	  for(ItemBean item: itemsList) {
                		    b = mdao.maintainOrderDetails(item, orderNo);
                		    if(b) {
                		    	System.out.println("Order details entered");
                		    }
                	  }
                   }
                   mdao.emptyCart();
                   orderItem = mdao.viewOrder(orderNo);
                   model.put("userName", userName);
                   model.put("orderNo", orderNo);
                   model.put("orderItem", orderItem);
                   return new ModelAndView("orderSuccess","model",model);
     }