protected void processRequest(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {

        Command cmd;
        
        String action = request.getParameter("action");
        switch (action) {
            case "saveUser":
             cmd = new SalvarUsuarioCommand();
                break;
            case "loginUser":
                cmd = new LoginUsuarioCommand();
                break;
            case "logoutUser":
                cmd = new LogoutUsuarioCommand();
                break;
            case "searchProduct":
                cmd = new BuscarProdutoCommand();
                break;
            case "loadProduct":
                cmd = new CarregarProdutoCommand();
                break;
            case "buyProduct":
                cmd = new ComprarProdutosCommand();
                break;
            default:
                cmd = null;
                break;
        }
        if(cmd!=null)
            cmd.execute(request, response);
        }