{"issue":{"created_at":"2011-10-08T16:13:14Z","state":"open","updated_at":"2011-11-29T23:41:48Z","comments":1,"user":{"gravatar_id":"1560943e1508e009a73f1cbb379835c6","id":1112561,"url":"https://api.github.com/users/guivirtuoso","login":"guivirtuoso","avatar_url":"https://secure.gravatar.com/avatar/1560943e1508e009a73f1cbb379835c6?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"body":"Ao usar a implementação abaixo, a resposta Json está saindo duplicada.\r\n\r\n    final SegUsuario usuarioLogado = segUsuarioDAO.carrega(segUsuario);\r\n \t    List<Message> errors = new Validations() {{\r\n \t        that(usuarioLogado != null, \"error\", localization.getMessage(\"usuario.login\"));    \r\n \t    }}.getErrors();    \r\n \t    validator.addAll(errors);\r\n \t    validator.onErrorUse(ExtJSJson.class).from(errors).success(false).serialize();\r\n\t    usuarioWeb.login(usuarioLogado ); // AUTENTICANDO NA SESSAO\r\n \t    result.redirectTo(MainController.class).main();\r\n\r\n\r\nPara corrigitar tal situação foi necessário realizar a implementação desta forma:\r\n\r\n\r\n    final SegUsuario usuarioLogado = segUsuarioDAO.carrega(segUsuario);  \r\n        List<Message> errors = new Validations() {{  \r\n            that(usuarioLogado != null, \"error\", localization.getMessage(\"usuario.login\"));  \r\n        }}.getErrors();  \r\n        if (!errors.isEmpty()) {\r\n             result.use(ExtJSJson.class).from(errors).success(Boolean.FALSE).serialize();  \r\n        } else {\r\n             usuarioWeb.login(usuarioLogado ); // AUTENTICANDO NA SESSAO O USUARIO LOGADO  \r\n             result.use(ExtJSJson.class).from(\"\").success().serialize();  \r\n        }\r\n","assignee":null,"id":1852890,"number":403,"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"labels":[],"title":"validator.onErrorUse(ExtJSon) duplicando o Json de resposta","html_url":"https://github.com/caelum/vraptor/issues/403","closed_at":null,"url":"https://api.github.com/repos/caelum/vraptor/issues/403","milestone":null},"action":"created","comment":{"created_at":"2011-11-29T23:41:48Z","updated_at":"2011-11-29T23:41:48Z","user":{"gravatar_id":"d6f57e3bef403176e3dabb8aa688c197","id":214363,"url":"https://api.github.com/users/yorgan","login":"yorgan","avatar_url":"https://secure.gravatar.com/avatar/d6f57e3bef403176e3dabb8aa688c197?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"body":"Mas não é mais interessante utilizar o validator.onErrorSendBadRequest(); para esse caso?","id":2952529,"url":"https://api.github.com/repos/caelum/vraptor/issues/comments/2952529"}}