From 705bfdad32876669dd91412abaf84556708c848d Mon Sep 17 00:00:00 2001 From: hengyunabc Date: Mon, 19 Apr 2021 16:53:12 +0800 Subject: [PATCH] update tutorials case-ognl-practise-cn --- .../katacoda/case-ognl-practise-cn/step1.md | 49 +++++++++++++++++-- .../katacoda/case-ognl-practise-en/step1.md | 43 ++++++++++++++++ 2 files changed, 89 insertions(+), 3 deletions(-) diff --git a/tutorials/katacoda/case-ognl-practise-cn/step1.md b/tutorials/katacoda/case-ognl-practise-cn/step1.md index ace129db5..c9267738e 100644 --- a/tutorials/katacoda/case-ognl-practise-cn/step1.md +++ b/tutorials/katacoda/case-ognl-practise-cn/step1.md @@ -10,14 +10,34 @@ `mvn compile exec:java`{{execute}} -代码里的表达式: + +输出结果包含`ognl`表达式输出结果: + +```java +AtEnter, conditionExpress: params[0] > 1, conditionResult: true +@ArrayList[ + @TestService[ + ], + @Object[][ + @Integer[1000], + @String[hello], + @Student[ + id=@Long[1], + name=@String[tom], + ], + ], +] +``` + + +以上输出结果,对应在代码里的表达式是: ```java String watchExpress = "{target, params, returnObj, #cost}"; String conditionExpress = "params[0] > 1 && #cost > 0.1"; ``` -结果类似下面的表达式: +类似在arthas里执行下面的`watch`命令: ```bash watch com.example.ognl.TestService test "{target, params, returnObj, #cost}" "params[0] > 1 && #cost > 0.1" -x 3 @@ -27,6 +47,29 @@ watch com.example.ognl.TestService test "{target, params, returnObj, #cost}" "pa `mvn compile exec:java -DexceptionCase=true`{{execute}} + +The output: + +```java +AtExceptionExit, conditionExpress: params[0] > 1, conditionResult: true +@ArrayList[ + @TestService[ + ], + @Object[][ + @Integer[1000], + @String[hello], + @Student[com.example.ognl.Student@6e23bcdd], + ], + java.lang.IllegalArgumentException: error + at com.example.ognl.TestService.test(TestService.java:12) + at com.example.ognl.Demo.test(Demo.java:43) + at com.example.ognl.Demo.main(Demo.java:20) + at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:254) + at java.base/java.lang.Thread.run(Thread.java:832) +, +] +``` + 代码里的表达式: ```java @@ -34,7 +77,7 @@ String watchExpress = "{target, params, throwExp}"; String conditionExpress = "params[0] > 1"; ``` -结果类似下面的表达式: +类似在arthas里执行下面的`watch`命令: ```bash watch com.example.ognl.TestService test "{target, params, throwExp}" "params[0] > 1" -e -x 2 diff --git a/tutorials/katacoda/case-ognl-practise-en/step1.md b/tutorials/katacoda/case-ognl-practise-en/step1.md index 5e83c6d78..6cea0e04f 100644 --- a/tutorials/katacoda/case-ognl-practise-en/step1.md +++ b/tutorials/katacoda/case-ognl-practise-en/step1.md @@ -11,6 +11,26 @@ Project: https://github.com/hengyunabc/ognl-demo `mvn compile exec:java`{{execute}} + +输出结果包含`ognl`表达式输出结果: + +```java +AtEnter, conditionExpress: params[0] > 1, conditionResult: true +@ArrayList[ + @TestService[ + ], + @Object[][ + @Integer[1000], + @String[hello], + @Student[ + id=@Long[1], + name=@String[tom], + ], + ], +] +``` + + Expression in the code: ```java @@ -28,6 +48,29 @@ watch com.example.ognl.TestService test "{target, params, returnObj, #cost}" "pa `mvn compile exec:java -DexceptionCase=true`{{execute}} + +The output: + +```java +AtExceptionExit, conditionExpress: params[0] > 1, conditionResult: true +@ArrayList[ + @TestService[ + ], + @Object[][ + @Integer[1000], + @String[hello], + @Student[com.example.ognl.Student@6e23bcdd], + ], + java.lang.IllegalArgumentException: error + at com.example.ognl.TestService.test(TestService.java:12) + at com.example.ognl.Demo.test(Demo.java:43) + at com.example.ognl.Demo.main(Demo.java:20) + at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:254) + at java.base/java.lang.Thread.run(Thread.java:832) +, +] +``` + Expression in the code: ```java