cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Fabien Thouny (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CXF-5352) @Multipart support for types that have constructors accepting a String parameter or static valueOf(String s) methods
Date Tue, 22 Oct 2013 12:22:49 GMT

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

Fabien Thouny commented on CXF-5352:
------------------------------------

I wrote this jira because such types are handled by Jersey's @FormDataParam and it seemed
obvious to me that @Multipart should do at least as much as Jersey ;-)

What i missed, you're right, is that @Multipart is much more powerful than @FormDataParam
because it already supports JSON/XML  body parts, and this feature can conflict with this
improvement.

@Multipart has a "type" parameter and we could use that to specify that it should be treated
as a "normal" parameter when "text/plain" :
{code}
@Multipart(value = "input", type = "text/plain") BeanWithStringConstructor input
{code}

I'm also curious to know how CXF differenciates JSON/XML payload and knows which MBR should
be applied when @Multipart doesn't precise the "type" parameter ?

Thanks for your answer and the time you spend on CXF, it's a really nice product !

Fabien



> @Multipart support for types that have constructors accepting a String parameter or static
valueOf(String s) methods
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: CXF-5352
>                 URL: https://issues.apache.org/jira/browse/CXF-5352
>             Project: CXF
>          Issue Type: Improvement
>          Components: JAX-RS
>    Affects Versions: 2.7.7
>            Reporter: Fabien Thouny
>            Priority: Minor
>
> For the moment, it's not possible to have the following resource :
> {code}
> @POST
> @Produces("application/json")
> @Consumes("multipart/form-data")
> public Response multipartWithBeanAndEnum(
>     @Multipart("input") BeanWithStringConstructor input,
>     @Multipart("someEnum") SomeEnum someEnum) {
>       [...]
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Mime
View raw message