Return-Path: X-Original-To: apmail-cxf-issues-archive@www.apache.org Delivered-To: apmail-cxf-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3005C109A6 for ; Tue, 4 Nov 2014 15:51:36 +0000 (UTC) Received: (qmail 23542 invoked by uid 500); 4 Nov 2014 15:51:35 -0000 Delivered-To: apmail-cxf-issues-archive@cxf.apache.org Received: (qmail 23351 invoked by uid 500); 4 Nov 2014 15:51:34 -0000 Mailing-List: contact issues-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list issues@cxf.apache.org Received: (qmail 23059 invoked by uid 99); 4 Nov 2014 15:51:34 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Nov 2014 15:51:34 +0000 Date: Tue, 4 Nov 2014 15:51:34 +0000 (UTC) From: "Constantino Cronemberger (JIRA)" To: issues@cxf.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CXF-6082) method Response.StatusType.getReasonPhrase is never called by CXF to generate a response MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CXF-6082?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14196267#comment-14196267 ] Constantino Cronemberger commented on CXF-6082: ----------------------------------------------- Yes, I think you mean my first comment. Well, never mind (I was just starting to think on what I could do to fix it), I saw in the linked issue that this is a problem with the spec, so I will not work on this now. I will create a servlet. Thanks for the feedback. > method Response.StatusType.getReasonPhrase is never called by CXF to generate a response > ---------------------------------------------------------------------------------------- > > Key: CXF-6082 > URL: https://issues.apache.org/jira/browse/CXF-6082 > Project: CXF > Issue Type: Bug > Components: JAX-RS > Affects Versions: 3.0.2 > Reporter: Constantino Cronemberger > > I am trying to send a JAX-RS response passing in a custom status code message and I found that with CXF this is not possible. > I checked the code and found that getReasonPhrase is never called and that neither HttpServletResponse.setStatus(int i, java.lang.String s) nor sendError(int i, java.lang.String s) are used in CXF. > In fact I found a call to getReasonPhrase in the getStatusInfo of the ResposeImpl class, but at the end it is only used by the method WebApplicationException.computeExceptionMessage to create the message text of the exception, but it would be necessary to call setStatus or sendError anyway. > Looks like this can be done with Jersey: > http://www.codingpedia.org/ama/custom-reason-phrase-in-http-status-error-message-response-with-jax-rs-jersey > but I have tested only with CXF. > The workaround for my case should be simple: instead of generating the response with an ExceptionMapper I will create a regular servlet error page which will call sendError appropriately. > I still don't have a clear idea of how I could implement this fix for CXF. -- This message was sent by Atlassian JIRA (v6.3.4#6332)