0

我想比较字符串但无法。考虑这个例子:

#set($foo = "a")
#set($bar = "a")

#if($foo == $bar) // Not the same
#if($foo == $bar.toString()) // The same
#if($foo.toString() == $bar) // The same

如果我投一个,那么它匹配吗?

Apache 网站上的示例显示了类似的用法(尽管有一个错字说这两种选择都不会匹配)

#set ($foo = "deoxyribonucleic acid")
#set ($bar = "ribonucleic acid")

#if ($foo == $bar)
  In this case it's clear they aren't equivalent. So...
#else
  They are not equivalent and this will be the output.
#end

当然,当项目属于 diff 类时,他们确实提到了强制转换为字符串,但这不是我的情况。

这是怎么回事?我正在使用 AppSync 本地插件在无服务器框架上执行此操作。问题可能存在吗?

更新awsutils 离线应用程序同步包中的潜在错误。已提交错误报告。敬请关注。

4

0 回答 0