|
From: And F. <and...@ya...> - 2008-10-14 13:51:31
|
Hi,
I am running in to an issue accessing the request parameters from the POST method
implementation. From with in the service, I am unable to access the parameters set by the
client. I am using the Resteasy 1.0 beta 8. I am not using any servlet filters.
Thanks
--------------------
//
// Server
//
@Post
@Produces("text/xml")
public String doSomething(@Context HttpServletRequest req) {
String query = req.getParameter("Query");
System.out.println("query = " + query); // always null
return "<Query>" + query + </Query>;
}
//
// Client using Apache HttpClient libraries
//
PostMethod method = new PostMethod("url");
method.addParameter("Query", "123");
:
HttpClient httpClient = new HttpClient();
int ret = httpClient.executeMethod(method);
//
// web.xml (simple and no servlet filters in place)
//
------------------
|