Return-Path: Delivered-To: apmail-cxf-users-archive@www.apache.org Received: (qmail 33587 invoked from network); 14 Oct 2009 01:02:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 14 Oct 2009 01:02:13 -0000 Received: (qmail 74647 invoked by uid 500); 14 Oct 2009 01:02:12 -0000 Delivered-To: apmail-cxf-users-archive@cxf.apache.org Received: (qmail 74585 invoked by uid 500); 14 Oct 2009 01:02:12 -0000 Mailing-List: contact users-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@cxf.apache.org Delivered-To: mailing list users@cxf.apache.org Received: (qmail 74573 invoked by uid 99); 14 Oct 2009 01:02:12 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Oct 2009 01:02:12 +0000 X-ASF-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00,HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of vincenzo.vitale@gmail.com designates 209.85.220.211 as permitted sender) Received: from [209.85.220.211] (HELO mail-fx0-f211.google.com) (209.85.220.211) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Oct 2009 01:02:09 +0000 Received: by fxm7 with SMTP id 7so10363374fxm.10 for ; Tue, 13 Oct 2009 18:01:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:from:date:message-id :subject:to:cc:content-type; bh=pMYVRJBWCJ3uDLp2HPFPNzX3W9Guf22BurygVCRnZZ8=; b=nFewV4r5ftf4ijFGyN0CyPqu1JQiZJwo6yuiK/72Nx6chufe3nBoumes18PF6cBfpL 3TUbCFjfkwwnp2z2+yEVq8JmMgqPYY1nwk4Mlx2OLwBalzrIcvhJ3aEORXihrwnfWEtS HYsO/9UDwzqOwLBDivYUSDiJDEdwaDP9esVZU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:cc:content-type; b=wg+lSuDbG3/MTpoaxpE+GlgC/zn33odUXQtOSoBRWdXC345HyNB8T3rA/NGqhEz3rh SdHiVS+szDDjVjHc6bu2wtBRCHDuIyZDlY+dUBMxTl4jhPkUXSXNFPZ552Nx5cnq2wSG MFWgyeqfPI1zQwGMxznrGc8dy0Grh79l3x9qs= MIME-Version: 1.0 Received: by 10.239.130.154 with SMTP id 26mr554271hbj.57.1255482108217; Tue, 13 Oct 2009 18:01:48 -0700 (PDT) From: Vincenzo Vitale Date: Wed, 14 Oct 2009 03:01:28 +0200 Message-ID: Subject: Setting the status code in the injected (via the jax-rs @context) HttpServletResponse To: users@cxf.apache.org Cc: pedro.assuncao@tomtom.com Content-Type: multipart/alternative; boundary=001485f5b0c01509c10475dab501 --001485f5b0c01509c10475dab501 Content-Type: text/plain; charset=ISO-8859-1 Hi, in my service implementation I'm injecting the HttpServletResponse with the @Context annotation: @POST @Path("/login") public Feed login(@PathParam("username") String username, @PathParam("password") String password, @Context HttpServletResponse httpServletResponse) and than I set the 401 status code when the user is not authorized. The problem is that the status code is than overwritten in the AbstractHTTPDestination class during the headers flushing: Integer i = (Integer)outMessage.get(Message.RESPONSE_CODE); if (i != null) { int status = i.intValue(); ... ... ... response.setStatus(status); is this the expected behaviour or is this a bug? Thanks in advance, Vincenzo. --001485f5b0c01509c10475dab501--