• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Devaka Cooray
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

@FormParam with CXF 2.2  RSS feed

 
Ranch Hand
Posts: 228
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am using CXF 2.2 for implementing restful services. I have a post method in the service
Ex:
@POST
@Path("/login")
public boolean login(@FormParam("userName") String userName,
@FormParam("password") String password )

I am not able to get the form param values in the service class there are always null. Does CXF 2.2 support @FromParam? If yes, is there any configuration to make it to work?

I am using apache commons http client to test my service:
Ex:
PostMethod post = new PostMethod("http://localhost:8080/rest/login");
post.addParameter("userName", "testuser");
post.addParameter("password", "testpassword");

HttpClient httpclient = new HttpClient();
int result = httpclient.executeMethod(post);

Could any one suggest me where am i doing wrong?

Thanks,
 
Saathvik Reddy
Ranch Hand
Posts: 228
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I realized i made a silly mistake. It works now.

Thanks,
 
It would give a normal human mental abilities to rival mine. To think it is just a tiny ad:
Enterprise Java integration with Delphi and Free Pascal applications - new release 2019.02
https://coderanch.com/t/705708/Enterprise-Java-integration-Delphi-Free
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!