@Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        //processRequest(request, response);
        try {
                if("true".equals(request.getParameter("doFeedback"))){
                    Transaction _transaction = new Transaction();
                    int _transactionID; //ID of the transaction from UserItems table

                    _transactionID = Integer.parseInt(request.getParameter("transactionID"));
                    _transaction.setTransactionID(_transactionID);

                    int _transactionSetID; //ID of the transaction from UserItems table
                    _transactionSetID = Integer.parseInt(request.getParameter("transactionSetID"));
                    
                    String _lenderComments = request.getParameter("lenderComments");
                    int _lenderRating = Integer.parseInt(request.getParameter("lenderRatingOfBorrower"));

                    ReturnItemService edit = new ReturnItemService();
                    
                    int _giverID = Integer.parseInt(request.getParameter("giverID"));
                    int _receiverID = Integer.parseInt(request.getParameter("receiverID"));

                    
                    Feedback _feedback = new Feedback();
                    _feedback.setComments(_lenderComments);
                    _feedback.setRating(_lenderRating);
                    _feedback.setTransactionSetID(_transactionSetID);
                    _feedback.setGiverID(_giverID);
                    _feedback.setReceiverID(_receiverID);
                    _feedback.setTransactionTypeID(4);

                    //_transaction.setLenderComments(_lenderComments);
                    //_transaction.setLenderRatingOfBorrower(_lenderRating);
                    //_transaction.setUserItemsID(_transactionID);

                    if(edit.acknowledgeReturn(_transaction) && edit.leaveFeedback(_feedback)){
                        response.sendRedirect("./feedbackSuccess.jsp");
                    }
                }
                if("true".equals(request.getParameter("returnItem"))){
                    
                    int _transactionID; //ID of the transaction from UserItems table
                    _transactionID = Integer.parseInt(request.getParameter("transactionID"));
                    
                    int _transactionSetID; //ID of the transaction from UserItems table
                    _transactionSetID = Integer.parseInt(request.getParameter("transactionSetID"));
                    
                    Transaction _transaction = new Transaction();
                    _transaction.setTransactionID(_transactionID);
                    
                    int _giverID = Integer.parseInt(request.getParameter("giverID"));
                    int _receiverID = Integer.parseInt(request.getParameter("receiverID"));

                    String _borrowerComments = request.getParameter("borrowerComments");
                    int _borrowerRating = Integer.parseInt(request.getParameter("borrowerRatingOfLender"));

                    Feedback _feedback = new Feedback();
                    _feedback.setComments(_borrowerComments);
                    _feedback.setRating(_borrowerRating);
                    _feedback.setTransactionSetID(_transactionSetID);
                    _feedback.setGiverID(_giverID);
                    _feedback.setReceiverID(_receiverID);
                    _feedback.setTransactionTypeID(3);
                    
                    //_transaction.setBorrowerComments(_borrowerComments);
                    //_transaction.setBorrowerRatingOfLender(_borrowerRating);
                    //_transaction.setUserItemsID(_transactionID);

                    ReturnItemService edit = new ReturnItemService();

                    if(edit.returnItem(_transaction) && edit.leaveFeedback(_feedback)){
                        response.sendRedirect("./returnSuccess.jsp");
                    }
                }
            
        } catch (Exception e){
 
        }
        
    }