@Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        SeviceStrategy service = new MenuService();
       String action = null;//action being performed
        String[] delete = null;//array of deleted entrees
        String name = null;//name of entree
        String price = null;//price
        String meal = null;//breakfast, lunch, or dinner
        String id = null;//id of entree
        int count = 0;//number of records updated
        String cnt = null;//return to jsp page 
                
                
        action = request.getParameter("action");
        
        
        
        /************** Delete Records *****************/
        if(action.equalsIgnoreCase("delete")){
        
        
        delete = request.getParameterValues("entree");
        
        try{
            
            count = service.deleteMenuItem(delete);
        }catch(Exception e){
            
        }
       
        cnt = Integer.toString(count);
            
       
        /*************** Add new Record ******************/
        }else if(action.equalsIgnoreCase("new")){
            name = request.getParameter("name");
            price = request.getParameter("price");
            meal = request.getParameter("meal");
             try{
              
               count = service.addNewMenuItem(price, meal, name);
               cnt = Integer.toString(count);
            }catch(Exception e){
               
            }
             
            
             
             
           
           
            
       /*************** Edit Record *********************/     
        }else if(action.equalsIgnoreCase("edit")){
            id= request.getParameter("id");
            name = request.getParameter("name");
            price = request.getParameter("price");
            meal = request.getParameter("meal");
            
            try{
              
               count = service.editEntreeItemById(id, price, meal, name);
               
            }catch(Exception e){
               
            }
            
           cnt = Integer.toString(count);
        
            
        }
        /***************end of edit***********************/
        
        
        if(cnt.equalsIgnoreCase("0")){
            cnt = "Error";
        }
        
         request.setAttribute("cnt", cnt);
       
        
         RequestDispatcher view =
                request.getRequestDispatcher("/output.jsp");
        view.forward(request, response);
        
        
        
        
    }