【发布时间】:2018-09-07 11:14:15
【问题描述】:
我的网址中有一个婴儿车,并在 DW 中用作:
<set-variable value=" #[output application/java --- ( (attributes.queryParams.filePath startsWith ('/opt/mypath/')))] .../>
如果我没有传递任何参数,我会收到异常:
Message : "You called the function 'startsWith' with these arguments:
1: Null (null)
2: String ("/opt/mypath/")
But it expects arguments of these types:
1: String
2: String
1| output application/java --- ( (attributes.queryParams.filePath startsWith ('/opt/mypath/')))
1) 如何验证 null?
2)如果没有传递参数,那么我想返回给用户提供参数并避免进一步的流动。是否可以在 DataWeave 中返回?还是我需要使用标准的 Groovy 脚本才能返回?
【问题讨论】: