apache camel simple expression not giving string value(apache骆驼简单表达式没有给出字符串值)
问题描述
我正在使用 apache 骆驼.我正在尝试使用简单的表达式语言从正文中检索值.我需要它作为字符串,但简单返回 SimpleBuilder 对象.所以我尝试过这样的事情
I am using apache camel. I am trying to retrieve value from body using simple expression language. I need it as a String but simple returns SimpleBuilder object. So I have tried something like this
simple("${body.address.line}").resultType(String.class).getResultType()
但它返回给我 java.lang.String.请告诉我如何才能将这个表达式的结果作为字符串?
but it is returning me java.lang.String. please tell me how can I get this expression's result as String?
推荐答案
那只是为了配置简单的表达式.如果你需要评估它然后调用评估方法
That is only for configuring the simple expression. If you need to evaluate it then call the evaluate method
String foo = simple("${body.address.line}").evaluate(exchange, String.class);
这篇关于apache骆驼简单表达式没有给出字符串值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:apache骆驼简单表达式没有给出字符串值
基础教程推荐
- 无法复制:“比较方法违反了它的一般约定!" 2022-01-01
- 如何对 Java Hashmap 中的值求和 2022-01-01
- 修改 void 函数的输入参数,然后读取 2022-01-01
- 存储 20 位数字的数据类型 2022-01-01
- Spring AOP错误无法懒惰地为此建议构建thisJoinPoin 2022-09-13
- 问题http://apache.org/xml/features/xinclude测试日志4j 2 2022-01-01
- RabbitMQ:消息保持“未确认"; 2022-01-01
- REST Web 服务返回 415 - 不支持的媒体类型 2022-01-01
- 使用堆栈算法进行括号/括号匹配 2022-01-01
- Struts2 URL 无法访问 2022-01-01
