Files

25 lines
1.2 KiB
Markdown
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
The result value of `watch`{{}} is generated by calculating the
`watch-express`{{}} ognl expression. You can change the ognl expression to
generate the desired value, please refer to
[OGNL document](https://commons.apache.org/proper/commons-ognl/language-guide.html).
> Maps can also be created using a special syntax.
>
> #{ "foo" : "foo value", "bar" : "bar value" }
>
> This creates a Map initialized with mappings for "foo" and "bar".
The following command generates values in map format:
`watch *MathGame prime* '#{ "params" : params, "returnObj" : returnObj, "throwExp": throwExp}' -x 2 -n 5`{{exec}}
When executing the above command in a Telnet shell/WebConsole, it will output the relevant information for `demo.MathGame.primeFactors`{{}} .
You can use `Q`{{exec}} or `Ctrl+C`{{}} to exit the watch command.
Execute the above command with Http api, pay attention to escaping the JSON double quotes:
`curl -Ss -XPOST http://localhost:8563/api -d '{"action":"exec","execTimeout":30000,"command":"watch *MathGame prime* #{\"params\":params,\"returnObj\":returnObj,\"throwExp\":throwExp} -n 3 "}' | json_pp`{{execute T3}}
You can see that the value of the watch result becomes a map object, and
the program can read value through a key .