[[el-language]]
= EL Language (deprecated)

*Available as of Camel version 1.1*

== EL
~~

Camel supports the unified JSP and JSF Expression Language via the
http://juel.sourceforge.net/[JUEL] to allow an
Expression or Predicate to be
used in the DSL or xref:latest@manual::xml-configuration.adoc[Xml
Configuration].

For example you could use EL inside a xref:latest@manual::filter-eip.adoc[Message
Filter] in XML

[source,xml]
---------------------------------------
<route>
  <from uri="seda:foo"/>
  <filter>
    <el>${in.headers.foo == 'bar'}</el>
    <to uri="seda:bar"/>
  </filter>
</route>
---------------------------------------

You could also use slightly different syntax, e.g. if the header name is
not a valid identifier:

[source,xml]
------------------------------------------------
<route>
  <from uri="seda:foo"/>
  <filter>
    <el>${in.headers['My Header'] == 'bar'}</el>
    <to uri="seda:bar"/>
  </filter>
</route>
------------------------------------------------

You could use EL to create an Predicate in a
Message Filter or as an
Expression for a
Recipient List

== EL Options



// language options: START
The EL language supports 1 options, which are listed below.



[width="100%",cols="2,1m,1m,6",options="header"]
|===
| Name | Default | Java Type | Description
| trim | true | Boolean | Whether to trim the value to remove leading and trailing whitespaces and line breaks
|===
// language options: END
// spring-boot-auto-configure options: START
== Spring Boot Auto-Configuration

When using Spring Boot make sure to use the following Maven dependency to have support for auto configuration:

[source,xml]
----
<dependency>
  <groupId>org.apache.camel</groupId>
  <artifactId>camel-juel-starter</artifactId>
  <version>x.x.x</version>
  <!-- use the same version as your Camel core version -->
</dependency>
----


The component supports 2 options, which are listed below.



[width="100%",cols="2,5,^1,2",options="header"]
|===
| Name | Description | Default | Type
| *camel.language.el.enabled* | Enable el language | true | Boolean
| *camel.language.el.trim* | Whether to trim the value to remove leading and trailing whitespaces and line breaks | true | Boolean
|===
// spring-boot-auto-configure options: END


== Variables

[width="100%",cols="10%,10%,80%",options="header",]
|=======================================================================
|Variable |Type |Description

|exchange |Exchange |the Exchange object

|in |Message |the exchange.in message

|out |Message |the exchange.out message
|=======================================================================

== Samples

You can use EL dot notation to invoke operations. If you for instance
have a body that contains a POJO that has a `getFamiliyName` method then
you can construct the syntax as follows:

[source,java]
-----------------------
"${in.body.familyName}"
-----------------------

== Dependencies

To use EL in your camel routes you need to add the a dependency on
*camel-juel* which implements the EL language.

If you use maven you could just add the following to your pom.xml,
substituting the version number for the latest & greatest release (see
the download page for the latest versions).

[source,java]
-------------------------------------
<dependency>
  <groupId>org.apache.camel</groupId>
  <artifactId>camel-juel</artifactId>
  <version>x.x.x</version>
</dependency>
-------------------------------------

Otherwise you'll also need to include
http://repo2.maven.org/maven2/de/odysseus/juel/juel/2.1.3/juel-2.1.3.jar[JUEL].
