이 콘텐츠는 선택한 언어로 제공되지 않습니다.
Chapter 23. The Object-Graph Navigation Language(OGNL)
Overview 링크 복사링크가 클립보드에 복사되었습니다!
OGNL is an expression language for getting and setting properties of Java objects. You use the same expression for both getting and setting the value of a property. The OGNL support is in the camel-ognl
module.
Camel on EAP deployment 링크 복사링크가 클립보드에 복사되었습니다!
This component is supported by the Camel on EAP (Wildfly Camel) framework, which offers a simplified deployment model on the Red Hat JBoss Enterprise Application Platform (JBoss EAP) container.
Adding the OGNL module 링크 복사링크가 클립보드에 복사되었습니다!
To use OGNL in your routes you need to add a dependency on camel-ognl
to your project as shown in Example 23.1, “Adding the camel-ognl dependency”.
Example 23.1. Adding the camel-ognl dependency
Static import 링크 복사링크가 클립보드에 복사되었습니다!
To use the ognl()
static method in your application code, include the following import statement in your Java source files:
import static org.apache.camel.language.ognl.OgnlExpression.ognl;
import static org.apache.camel.language.ognl.OgnlExpression.ognl;
Built-in variables 링크 복사링크가 클립보드에 복사되었습니다!
Table 23.1, “OGNL variables” lists the built-in variables that are accessible when using OGNL.
Name | Type | Description |
---|---|---|
|
| The current Exchange |
|
| The current Exchange |
|
| the Exchange exception (if any) |
|
| the Exchange ID |
|
| The Fault message(if any) |
|
| The IN message |
|
| The OUT message |
|
| The Exchange properties |
|
| The value of the named Exchange property |
|
| The typed value of the named Exchange property |
Example 링크 복사링크가 클립보드에 복사되었습니다!
Example 23.2, “Route using OGNL” shows a route that uses OGNL.
Example 23.2. Route using OGNL