@Override
    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        if (request.getRequestURI().endsWith("/login")) {
            response.sendRedirect("/carrinho/login.jsp");
        } else if (request.getRequestURI().endsWith("/login/access")) {
            Response<Login> responseData = null;
            if (!Util.isEmpty(request.getParameter("data"))) {
                String data = getData(request);
                Login login = gson.fromJson(data, Login.class);
                Usuarios usuario = null;
                try {
                    usuario = (Usuarios) GenericDao.getFirstByNameQuery("Usuarios.login",
                            new ParametersQuery("login", login.getUser()),
                            new ParametersQuery("senha", login.getPassword()));
                    if (usuario != null) {
                        usuario.setListasCollection(null);
                        request.getSession().setAttribute("sessionUser", usuario);
                        responseData = new Response<Login>(login, "success", "Login efetuado com sucesso.");
                    } else {
                        responseData = new Response<Login>(login, "error", "Usuário ou senha incorreto!");
                    }
                } catch (Exception ex) {
                    responseData = new Response<Login>(login, "error", "Erro tentar logar: " + ex.getMessage());
                } finally {
                    sendResponseJson(response, responseData);
                }
            }else{
                responseData = new Response<Login>(null, "error", "Usuário e senha devem ser informados!");
                response.getWriter().print(gson.toJson(responseData));
            }
        } else if (request.getRequestURI().endsWith("/login/logoff")) {
            request.getSession().removeAttribute("sessionUser");
            response.sendRedirect("/carrinho/login");
        } 
    }