cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David people (JIRA)" <>
Subject [jira] Commented: (CXF-2154) Cannot get Form values from MultivaluedMap
Date Wed, 08 Apr 2009 13:17:13 GMT


David people commented on CXF-2154:

Ok here is a simple test case..

Here is the Class



public class TestRest {
	    public Response updateStatus(MultivaluedMap<String, String> params) throws Exception
	        return Response.ok(params.getFirst("status")).build(); 

Here is the Spring config

<beans xmlns=""
	<import resource="classpath:META-INF/cxf/cxf.xml" />
	<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
	<import resource="classpath:META-INF/cxf/cxf-extension-http-binding.xml"/>
	<import resource="classpath:META-INF/cxf/cxf-extension-jaxrs-binding.xml" />
	<import resource="classpath:META-INF/cxf/cxf-servlet.xml" />

            <jaxrs:server id="JaxRS-Server" address="/">
	         <ref bean="testRest"/>
           <bean id="testRest" class="">


Here is the test html

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  <TITLE> New Document </TITLE>
  <META NAME="Generator" CONTENT="EditPlus">
  <META NAME="Author" CONTENT="">
  <META NAME="Keywords" CONTENT="">
  <META NAME="Description" CONTENT="">

    <form method="POST" action="http://localhost:8080/webapp/webservice/testRest" >
      <input type="text" value="open" name="status"/> 
      <input type="text" value="testing123" name="test1"/> 
      <input type="submit"/> 


Here is the tomcat output

And here is what displays on IE 7
The XML page cannot be displayed 
Cannot view XML input using style sheet. Please correct the error and then click the Refresh
button, or try again later. 


XML document must have a top level element. Error processing resource 'http://localhost:8080/webapp/webservice/testRest'.

I'm beginning to think this is a classpath problem with a bad jar somewhere....

Many thanks....

> Cannot get Form values from MultivaluedMap
> ------------------------------------------
>                 Key: CXF-2154
>                 URL:
>             Project: CXF
>          Issue Type: Bug
>          Components: REST
>    Affects Versions: 2.2
>         Environment: Windows XP Java 1.6 tomcat
>            Reporter: David people
> 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
> @Path("/temp")
> 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.

View raw message