Hello, for the following request in my application:
.../myresource?source=a&target=b
I'm trying to retrieve both the values of the parameters source and target:
public class MyResource extends Resource {
public MyResource(Context context, Request request, Response response) {
super(context, request, response);
for(Parameter p : request.getEntityAsForm()) {
logger.warn("parameter: " + p.getName() + "; value: " +
p.getValue());
}
}
}
I am using Mule Restlet transport 1.2 and Restlet 1.1.1.
Output:
parameter: source; value: a
I would like to see:
parameter: source; value: a
parameter: target; value: b
Essentially only the first parameter is seen in the query string. When I ask
the form for the query string via getQueryString(),
I also only see the first parameter, as in "source=a".
I have also tried the following methods, but I would surmise they're equivalent:
Map<String,String> parameters = reqeust.getQueryAsForm().getValuesMap();
String source = parameters.get("source");
String target = parameters.get("target");
Also:
Form form = request.getQueryAsForm()
String source = form.getFirstValue("source");
String target = form.getFirstValue("target");
I was wondering if I might be missing something?
Thanks in advance - John
------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2387631