[
https://issues.apache.org/jira/browse/CXF-2154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12696996#action_12696996
]
Sergey Beryozkin commented on CXF-2154:
---------------------------------------
thanks, so I still can't reproduce it, may be because I'm running it against my
own test class :
The Request :
POST /testJaxrs/petstore/pets HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
application/msword, application/vnd.ms-powerpoint, application/vnd.ms-excel,
application/x-shockwave-flash, application/x-silverlight,
application/x-ms-application, application/x-ms-xbap,
application/vnd.ms-xpsdocument, application/xaml+xml, */*
Accept-Language: en-ie
Content-Type: application/x-www-form-urlencoded
UA-CPU: x86
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR
1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET
CLR 3.0.4506.2152; .NET CLR 3.5.30729)
Host: localhost:8081
Content-Length: 119
Connection: Keep-Alive
Cache-Control: no-cache
status=open&1docType=1&1countryCode=2&1clientType=3&1action=4&1originals=5&1copies=6&1currency=7&1amount=8&1chamberId=9
Tomcat output :
{status=[open], 1docType=[1], 1countryCode=[2], 1clientType=[3], 1action=[4], 1o
riginals=[5], 1copies=[6], 1currency=[7], 1amount=[8], 1chamberId=[9]}
The test class :
@Path("/petstore/")
public class PetStore {
public static final String CLOSED = "The Pet Store is closed";
public PetStore() {
}
@POST
@Path("/pets/")
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
@Produces("text/xml")
public Response updateStatus(MultivaluedMap<String, String> params) throws
Exception {
System.out.println(params);
return Response.ok(params.getFirst("status")).build();
}
}
I only added 'status' to the test form.
Can you please add a sample test class as well, so that I can compile it and
try posting to it ?
> Cannot get Form values from MultivaluedMap
> ------------------------------------------
>
> Key: CXF-2154
> URL: https://issues.apache.org/jira/browse/CXF-2154
> Project: CXF
> Issue Type: Bug
> Components: REST
> Affects Versions: 2.2
> Environment: Windows XP Java 1.6 tomcat
> Reporter: David people
> Attachments: testRest.html
>
>
> Hi,
> I'm trying to get All the form fields from a a form which is posted to the
> restful web service.
> <form method="POST"
> action="http://localhost:8080/webapp/webservice/customerservice/temp" >
> <input type="text" value="hello" name="param1"/>
> <input type="text" value="hfsello" name="param2"/>
> <input type="submit"/>
> </form>
> I have the following method
> @POST
> @Path("/temp")
> @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
> public String temp(MultivaluedMap<String, String> params){
> System.out.println("Params = "+params);
> return "<done>"+params+"</done>";
> }
> The output is always empty, the size of the params object is zero.
> The very same method used to work in a previous version of CXF.
> Is there a new way to use MultivaluedMap?
> Thanks...
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.