cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Kulp (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (CXF-4782) Cannot easily override the Accept content type
Date Fri, 24 Mar 2017 14:33:41 GMT

     [ https://issues.apache.org/jira/browse/CXF-4782?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Daniel Kulp resolved CXF-4782.
------------------------------
       Resolution: Won't Fix
         Assignee: Daniel Kulp
    Fix Version/s: Invalid

As Sergey mentioned, doing this type of custom overrides almost always requires an interceptor
or similar.

> 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
>            Assignee: Daniel Kulp
>             Fix For: Invalid
>
>
> 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 was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message