本文介绍了ule子表达式转换器异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

我有一个有效载荷,例如

I have a payload like

{"jcr:createdBy":"admin","jcr:content":{"sling:resourceType":"contentpage","addressdetails":{"state":"vic"}}}

我想更改state的值.我尝试了以下方法,

I want to change the value of state. I have tried the below,

<expression-transformer
                    expression="#[message.payload.jcr:content.addressdetails.state = 'NSW';message.payload]"
                    doc:name="Expression" />

但这会引发异常,无效的表达式.我相信这是因为:在jcr:createdBy中.我该如何处理?

but this throws an exception, invalid expression.I believe its because of : in jcr:createdBy. How should I handle this?

推荐答案

尝试在表达式前输入<json:json-to-object-transformer returnClass="java.util.HashMap" />,如下所示:-

Try <json:json-to-object-transformer returnClass="java.util.HashMap" /> before expression like following :-

<json:json-to-object-transformer returnClass="java.util.HashMap" />
<expression-transformer expression="#[message.payload.jcr.content:addressdetails.state = 'NSW';message.payload]"  doc:name="Expression" />

这篇关于ule子表达式转换器异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-07 02:20