
Questions: 23,716 //
Answers: 52,286 //
Contributing Members: 17,985
In mule flow, I can write something like this:
<set-variable variableName="aaa" value="#[message.inboundProperties['http.query.params'].getAll('a')]" doc:name="Get Query Param" />
If I try that in Java, I get an error "The method getAll(String) is undefined for the type Map":
private String[] GetQueryParamValues(MuleMessage muleMessage, String parameterName) {
Map<String, String> queryParams = muleMessage.getInboundProperty("http.query.params");
return queryParams.getAll(parameterName);
}
Oct 24, 2017 at 09:28 AM, rprins answered with:
Hi @Mladen Bukejlović ,
You are using the wrong Map class. Check the online API documentation for more details, but you should be using something like this:
@Override
public Object onCall(MuleEventContext eventContext) throws Exception {
MuleMessage message = eventContext.getMessage();
org.mule.module.http.internal.ParameterMap map = message.getInboundProperty("http.query.params");
String name = map.get("name");
message.setPayload("Hello " +name);
return message;
}
This example assumes a query parameter "name".
Oct 26, 2017 at 05:21 PM, anirban37 answered with:
@Mladen Bukejlović This is already asked many times in the forum and with little search you could have easily get it here :- https://forums.mulesoft.com/questions/2115/http-inbound-http-query-parameters-how-to-extract-it.html
Check the comment section under the answer
How do I get visibility to reused/repeated http query parameters? 6 Answers
Best practice to improve the cache performance in mule 2 Answers
Two java pocess on mule start 0 Answers
HTTPS - Let's Encrypt + Apache 1 Answer
how to obtain MuleContext and get the instance of ObjectStore in the java backend? 3 Answers