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 EB681EB69 for ; Fri, 25 Jan 2013 11:19:13 +0000 (UTC) Received: (qmail 52393 invoked by uid 500); 25 Jan 2013 11:19:13 -0000 Delivered-To: apmail-cxf-issues-archive@cxf.apache.org Received: (qmail 52276 invoked by uid 500); 25 Jan 2013 11:19:13 -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 51776 invoked by uid 99); 25 Jan 2013 11:19:12 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 25 Jan 2013 11:19:12 +0000 Date: Fri, 25 Jan 2013 11:19:12 +0000 (UTC) From: "Sergey Beryozkin (JIRA)" To: issues@cxf.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CXF-4782) Cannot easily override the Accept content type 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-4782?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13562610#comment-13562610 ] Sergey Beryozkin commented on CXF-4782: --------------------------------------- I think you can simply write a basic CXF interceptor which will sit at any stage before or at the one used by JAXRSInInterceptor and replace "_type" with "format" by updating Message.QUERY_STRING on the message; and also update RequestPreprocessor by getting it from the message: {code:java} ProviderFactory providerFactory = ProviderFactory.getInstance(message); RequestPreprocessor rp = providerFactory.getRequestPreprocessor(); {code} Hope it will do it > Cannot easily override the Accept content type > ---------------------------------------------- > > Key: CXF-4782 > URL: https://issues.apache.org/jira/browse/CXF-4782 > Project: CXF > Issue Type: Bug > Components: JAX-RS > Affects Versions: 2.7.2 > Reporter: Jason Chaffee > > I need to add the ability to override the Accept header using a query parameter. I know CXF supports "_type", but there are two problems with the way that is implemented that won't work for us. 1) We need to parameter name to be "format" instead of "_type" and currently this is not configurable. 2) We need to be able to pass in a map of special type that we would like to map. This would added to the SHORTCUTS. > Since the current RequestPreProcessor doesn't allow for either one of those, I decided to write a JAXRS Filter/RequestHandler. The problem I found is that the JAXRSInInterceptor has already looked up the acceptContentType before my RequestHandler.handleRequest() method is called. Thus, I am unable to override it using this approach. > Ideally, the fix would be to simply make them configurable in the RequestPreProcessor. However, I am not quite sure how that would be done since this is not a class that is managed/configured in the IoC/DI container. > Another approach would be to call the RequestHandlers before resolving the acceptContentType. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira