Skip to content
Justin Gill edited this page Apr 17, 2014 · 1 revision

General

http://mulesoft.github.com/mule-module-mvel/usage.html

http://www.mulesoft.org/documentation/display/current/MEL+Cheat+Sheet

http://www.mulesoft.org/documentation/download/attachments/75661459/refcard-mel.pdf

create an integer

#[1000]

call a static method

#[java.net.URLEncoder.encode('hello nurse')]

create a hash map

#[new java.util.HashMap()]

in a choice check for null payload

#[payload != null && ((payload instanceof org.mule.transport.NullPayload) == false)]

HTTP

check if a query string parameter named date exists

#[message.inboundProperties['http.query.params']['date'] != null]

in a set-payload transformer, rewrite the string payload to include the callback query string param and \n

#[message.inboundProperties['http.query.params']['callback']](#['\n']#[message.payload]#['\n'])

All HTTP Properties available in inboundProperties

http.context.path: The context path of the endpoint being accessed. This is the path that the HTTP endpoint is listening on.
http.context.uri: The context URI of the endpoint being accessed, it corresponds to the address of the endpoint.
http.headers: A Map containing all the HTTP headers.
http.method: The name of the HTTP method as used in the HTTP request line.
http.query.params: A Map containing all the query parameters. It supports multiple values per key and both key and value are unescaped.
http.query.string: The query string of the URL.
http.request: The path and query portions of the URL being accessed.
http.request.path: The path the URL being accessed. It does not include the query portion.
http.relative.path: The relative path of the URI being accessed in relation to the context path.
http.status: The status code associated with the latest response.
http.version: The HTTP-Version.
Clone this wiki locally