Author: buildbot Date: Wed Mar 13 16:19:22 2013 New Revision: 854294 Log: Production update by buildbot for camel
Modified: websites/production/camel/content/cache/main.pageCache websites/production/camel/content/spel.html Modified: websites/production/camel/content/cache/main.pageCache ============================================================================== Binary files - no diff available. Modified: websites/production/camel/content/spel.html ============================================================================== --- websites/production/camel/content/spel.html (original) +++ websites/production/camel/content/spel.html Wed Mar 13 16:19:22 2013 @@ -102,6 +102,15 @@ from(<span class="code-quote">"direct:ex </pre> </div></div> +<p>In the route above, notice spel is a static method which we need to import from <tt>org.apache.camel.language.spel.SpelExpression.spel</tt>, as we use spel as an <a shape="rect" href="expression.html" title="Expression">Expression</a> passed in as a parameter to the <tt>setBody</tt> method. Though if we use the fluent API we can do this instead:</p> +<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent"> +<pre class="code-java"> +from(<span class="code-quote">"direct:example"</span>).setBody().spel(<span class="code-quote">"Hello #{request.body}! What a beautiful #{request.headers['dayOrNight']}"</span>).to(<span class="code-quote">"mock:result"</span>); +</pre> +</div></div> + +<p>Notice we now use the <tt>spel</tt> method from the <tt>setBody()</tt> method. And this does not require us to static import the spel method from <tt>org.apache.camel.language.spel.SpelExpression.spel</tt>.</p> + <p>And sent a message with the string "World" in the body, and a header "dayOrNight" with value "day":</p> <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent"> <pre class="code-java">