protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        response.setContentType("text/html;charset=UTF-8");
        PrintWriter out = response.getWriter();
        try {

            String funcion = request.getParameter("funcion");

            if (funcion == null) {
                //error
            } else {
                if (funcion.equals("alta")) {
                    boolean rta = NuevaCompra(request, response);
                    if(rta)
                    {
                        out.println("history.jsp");
                    }
                    
                } else if (funcion.equals("confirmar")) {
                    boolean rta = ConfirmarCompra(request, response);
                    if(rta)
                    {
                        request.getSession().setAttribute("ABMCompras", new String("Compra confirmada"));
                    }
                    else
                    {
                        request.getSession().setAttribute("ABMCompras", new String("Error al confirmar compra"));
                    }
                    
                } else if (funcion.equals("rechazar")) {
                    boolean rta = RechazarCompra(request, response);
                    if(rta)
                    {
                        request.getSession().setAttribute("ABMCompras", new String("Compra rechazada"));
                    }
                    else
                    {
                        request.getSession().setAttribute("ABMCompras", new String("Error al rechazar compra"));
                    }
                }
            }

        } catch (Exception ex) {

        } finally {
            out.close();
        }
    }