cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Constantino Cronemberger (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CXF-6082) method Response.StatusType.getReasonPhrase is never called by CXF to generate a response
Date Tue, 04 Nov 2014 15:51:34 GMT

    [ 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)

Mime
View raw message