[ 
https://issues.apache.org/jira/browse/WINK-35?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12727910#action_12727910
 ] 

Nadav Fischer commented on WINK-35:
-----------------------------------

I actually tried a while ago to implement this functionality but still came 
across some issues. 

I can't remember all of them, but one that comes to mind is how to handle the 
situations that the entity parameter is the first parameter of the method and 
the FormParam comes after it. It's fairly straightforward to handle if the 
FormParam comes before the entity parameter, but when it's the other way 
around, we'll need to add special "if form parameter" code to places that I'm 
not sure it belongs.

I feel that all that has to be done (code wise) to support this properly for 
all possible situation isn't worth the code complication right now, and I'd 
rather we don't support it all than support it partially.

In any case, If you still feel that it's important, how about we postpone this 
until after 0.1 is out? we can always add it later.

> Entity lost when using application/x-www-form-urlencoded media type and 
> FormParam
> ---------------------------------------------------------------------------------
>
>                 Key: WINK-35
>                 URL: https://issues.apache.org/jira/browse/WINK-35
>             Project: Wink
>          Issue Type: Bug
>          Components: Common
>    Affects Versions: 0.1
>            Reporter: Jesse Ramos
>            Priority: Minor
>         Attachments: diff.txt
>
>
> When using the application/x-www-form-urlencoded media type, if a resource 
> method uses the FormParam annotation for one parameter and specifies an 
> entity parameter, the entity parameter value is lost before being injected.  
> This is a sample method header:
>         @POST
>         @Path("withOneKeyAndEntity")
>         public String getRes(@FormParam("firstkey") String firstKey,
>                              MultivaluedMap<String, String> entity)
> When obtaining the value for the FormParam parameter, the entity is read from 
> the input stream.  When the input stream is later read for the entity 
> parameter the entity is no longer on the input stream.  The read is done in 
> the FormMultivaluedMapProvider entity provider.
> This is an edge case because it's not likely that a user will use the 
> FormParam to get the values of form parameters and also get all the 
> parameters in the entity MultivaluedMap paramter.  However, technically it 
> should be supported.
> Will upload a patch.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to