You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Sergey Beryozkin (JIRA)" <ji...@apache.org> on 2013/04/18 12:19:17 UTC

[jira] [Commented] (CXF-4782) Cannot easily override the Accept content type

    [ https://issues.apache.org/jira/browse/CXF-4782?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13635061#comment-13635061 ] 

Sergey Beryozkin commented on CXF-4782:
---------------------------------------

Hi Jason - does the above work for you ?
                
> 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