You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by bu...@apache.org on 2013/08/22 16:19:39 UTC

svn commit: r875703 [1/2] - in /websites/production/camel/content: book-component-appendix.html book-in-one-page.html cache/main.pageCache crypto-digital-signatures.html netty-http.html

Author: buildbot
Date: Thu Aug 22 14:19:39 2013
New Revision: 875703

Log:
Production update by buildbot for camel

Modified:
    websites/production/camel/content/book-component-appendix.html
    websites/production/camel/content/book-in-one-page.html
    websites/production/camel/content/cache/main.pageCache
    websites/production/camel/content/crypto-digital-signatures.html
    websites/production/camel/content/netty-http.html

Modified: websites/production/camel/content/book-component-appendix.html
==============================================================================
--- websites/production/camel/content/book-component-appendix.html (original)
+++ websites/production/camel/content/book-component-appendix.html Thu Aug 22 14:19:39 2013
@@ -1688,7 +1688,7 @@ crypto:verify:name[?options]
 
 <h3><a shape="rect" name="BookComponentAppendix-Options"></a>Options</h3>
 <div class="confluenceTableSmall"><div class="table-wrap">
-<table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"> Name </th><th colspan="1" rowspan="1" class="confluenceTh"> Type </th><th colspan="1" rowspan="1" class="confluenceTh"> Default </th><th colspan="1" rowspan="1" class="confluenceTh"> Description </th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>algorithm</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>String</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>DSA</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> The name of the JCE Signature algorithm that will be used. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>alias</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>String</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>null</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> An alias name that will be used to select a key from the keystore. </td></tr><tr><td colspan="1" row
 span="1" class="confluenceTd"> <tt>bufferSize</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>Integer</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>2048</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> the size of the buffer used in the signature process. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>certificate</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>Certificate</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>null</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> A Certificate used to verify the signature of the exchange's payload. Either this or a Public Key is required. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>keystore</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>KeyStore</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>null</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> A reference to a JCE 
 Keystore that stores keys and certificates used to sign and verify. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>provider</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>String</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>null</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> The name of the JCE Security Provider that should be used. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>privateKey</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>PrivateKey</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>null</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> The private key used to sign the exchange's payload. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>publicKey</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>PublicKey</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>null</tt> </td><td colspan="1" rowspan="1
 " class="confluenceTd"> The public key used to verify the signature of the exchange's payload. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>secureRandom</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>secureRandom</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>null</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> A reference to a <tt>SecureRandom</tt> object that will be used to initialize the Signature service. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>password</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>char[]</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>null</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> The password for the keystore. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>clearHeaders</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>String</tt> </td><td colspan="1" rowspan="1" class="confluenc
 eTd"> <tt>true</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> Remove camel crypto headers from Message after a verify operation (value can be <tt>"true"</tt>/<tt>"false"</tt>). </td></tr></tbody></table>
+<table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"> Name </th><th colspan="1" rowspan="1" class="confluenceTh"> Type </th><th colspan="1" rowspan="1" class="confluenceTh"> Default </th><th colspan="1" rowspan="1" class="confluenceTh"> Description </th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>algorithm</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>String</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>SHA1WithDSA</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> The name of the JCE Signature algorithm that will be used. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>alias</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>String</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>null</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> An alias name that will be used to select a key from the keystore. </td></tr><tr><td colspan
 ="1" rowspan="1" class="confluenceTd"> <tt>bufferSize</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>Integer</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>2048</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> the size of the buffer used in the signature process. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>certificate</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>Certificate</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>null</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> A Certificate used to verify the signature of the exchange's payload. Either this or a Public Key is required. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>keystore</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>KeyStore</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>null</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> A reference t
 o a JCE Keystore that stores keys and certificates used to sign and verify. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>provider</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>String</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>null</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> The name of the JCE Security Provider that should be used. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>privateKey</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>PrivateKey</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>null</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> The private key used to sign the exchange's payload. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>publicKey</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>PublicKey</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>null</tt> </td><td colspan="1" ro
 wspan="1" class="confluenceTd"> The public key used to verify the signature of the exchange's payload. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>secureRandom</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>secureRandom</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>null</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> A reference to a <tt>SecureRandom</tt> object that will be used to initialize the Signature service. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>password</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>char[]</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>null</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> The password for the keystore. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>clearHeaders</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>String</tt> </td><td colspan="1" rowspan="1" class="c
 onfluenceTd"> <tt>true</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> Remove camel crypto headers from Message after a verify operation (value can be <tt>"true"</tt>/<tt>"false"</tt>). </td></tr></tbody></table>
 </div>
 </div>
 
@@ -2777,7 +2777,16 @@ cxfbean:serviceBeanRef
 ]]></script>
 </div></div>
 <p>The <tt>to</tt> endpoint is a CXF Bean with bean name <tt>customerServiceBean</tt>. The name will be looked up from the registry.  Next, we make sure our service bean is available in Spring registry.  We create a bean definition in the Spring configuration.  In this example, we create a List of service beans (of one element).  We could have created just a single bean without a List.</p>
-<div class="error"><span class="error">Error formatting macro: snippet: java.lang.IndexOutOfBoundsException: Index: 20, Size: 20</span> </div>
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[
+&lt;util:list id="customerServiceBean"&gt;
+	&lt;bean class="org.apache.camel.component.cxf.jaxrs.testbean.CustomerService" /&gt;
+&lt;/util:list&gt;
+
+&lt;bean class="org.apache.camel.wsdl_first.PersonImpl" id="jaxwsBean" /&gt;
+
+]]></script>
+</div></div>
 <p>That's it.  Once the route is started, the web service is ready for business.  A HTTP client can make a request and receive response.</p>
 
 <h2><a shape="rect" name="BookComponentAppendix-CXFRSComponent"></a>CXFRS Component</h2>
@@ -3489,7 +3498,22 @@ public interface GreaterLocal {
 </div></div>
 
 <p>And the implementation</p>
-<div class="error"><span class="error">Error formatting macro: snippet: java.lang.IndexOutOfBoundsException: Index: 20, Size: 20</span> </div>
+<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader" style="border-bottom-width: 1px;"><b>GreaterImpl.java</b></div><div class="codeContent panelContent">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+@Stateless
+public class GreaterImpl implements GreaterLocal {
+
+    public String hello(String name) {
+        return "Hello " + name;
+    }
+
+    public String bye(String name) {
+        return "Bye " + name;
+    }
+
+}
+]]></script>
+</div></div>
 
 <h4><a shape="rect" name="BookComponentAppendix-UsingJavaDSL"></a>Using Java DSL</h4>
 
@@ -3520,7 +3544,14 @@ private static Context createEjbContext(
 
 <p>Then we are ready to use the EJB in the Camel route:</p>
 
-<div class="error"><span class="error">Error formatting macro: snippet: java.lang.IndexOutOfBoundsException: Index: 20, Size: 20</span> </div>
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+from("direct:start")
+    // invoke the greeter EJB using the local interface and invoke the hello method
+    .to("ejb:GreaterImplLocal?method=hello")
+    .to("mock:result");
+]]></script>
+</div></div>
 
 <div class="panelMacro"><table class="tipMacro"><colgroup span="1"><col span="1" width="24"><col span="1"></colgroup><tr><td colspan="1" rowspan="1" valign="top"><img align="middle" src="https://cwiki.apache.org/confluence/images/icons/emoticons/check.gif" width="16" height="16" alt="" border="0"></td><td colspan="1" rowspan="1"><b>In a real application server</b><br clear="none">In a real application server you most likely do not have to setup a <tt>JndiContext</tt> on the <a shape="rect" href="ejb.html" title="EJB">EJB</a> component as it will create a default <tt>JndiContext</tt> on the same JVM as the application server, which usually allows it to access the JNDI registry and lookup the <a shape="rect" href="ejb.html" title="EJB">EJB</a>s.<br clear="none">
 However if you need to access a application server on a remote JVM or the likes, you have to prepare the properties beforehand.</td></tr></table></div>
@@ -3531,11 +3562,33 @@ However if you need to access a applicat
 
 <p>Again since this is based on an unit test we need to setup the <a shape="rect" href="ejb.html" title="EJB">EJB</a> component:</p>
 
-<div class="error"><span class="error">Error formatting macro: snippet: java.lang.IndexOutOfBoundsException: Index: 20, Size: 20</span> </div>
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[
+&lt;!-- setup Camel EJB component --&gt;
+&lt;bean id="ejb" class="org.apache.camel.component.ejb.EjbComponent"&gt;
+    &lt;property name="properties" ref="jndiProperties"/&gt;
+&lt;/bean&gt;
+
+&lt;!-- use OpenEJB context factory --&gt;
+&lt;p:properties id="jndiProperties"&gt;
+    &lt;prop key="java.naming.factory.initial"&gt;org.apache.openejb.client.LocalInitialContextFactory&lt;/prop&gt;
+&lt;/p:properties&gt;
+]]></script>
+</div></div>
 
 <p>Before we are ready to use <a shape="rect" href="ejb.html" title="EJB">EJB</a> in the Camel routes:</p>
 
-<div class="error"><span class="error">Error formatting macro: snippet: java.lang.IndexOutOfBoundsException: Index: 20, Size: 20</span> </div>
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[
+&lt;camelContext xmlns="http://camel.apache.org/schema/spring"&gt;
+    &lt;route&gt;
+        &lt;from uri="direct:start"/&gt;
+        &lt;to uri="ejb:GreaterImplLocal?method=hello"/&gt;
+        &lt;to uri="mock:result"/&gt;
+    &lt;/route&gt;
+&lt;/camelContext&gt;
+]]></script>
+</div></div>
 
 
 
@@ -9650,7 +9703,12 @@ Destination replyDestination = exchange.
 
 <p>In the sample below we send a <a shape="rect" href="request-reply.html" title="Request Reply">Request Reply</a> style message <a shape="rect" href="exchange.html" title="Exchange">Exchange</a> (we use the <tt>requestBody</tt> method = <tt>InOut</tt>) to the slow queue for further processing in Camel and we wait for a return reply:</p>
 
-<div class="error"><span class="error">Error formatting macro: snippet: java.lang.IndexOutOfBoundsException: Index: 20, Size: 20</span> </div>
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+// send a in-out with a timeout for 5 sec
+Object out = template.requestBody("activemq:queue:slow?requestTimeout=5000", "Hello World");
+]]></script>
+</div></div>
 
 <h3><a shape="rect" name="BookComponentAppendix-Samples"></a>Samples</h3>
 
@@ -10306,10 +10364,20 @@ from("direct:start").to("language:simple
 </div></div>
 
 <p>In case you want to convert the message body type you can do this as well:</p>
-<div class="error"><span class="error">Error formatting macro: snippet: java.lang.IndexOutOfBoundsException: Index: 20, Size: 20</span> </div>
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+String script = URLEncoder.encode("${mandatoryBodyAs(String)}", "UTF-8");
+from("direct:start").to("language:simple:" + script).to("mock:result");
+]]></script>
+</div></div>
 
 <p>You can also use the <a shape="rect" href="groovy.html" title="Groovy">Groovy</a> language, such as this example where the input message will by multiplied with 2:</p>
-<div class="error"><span class="error">Error formatting macro: snippet: java.lang.IndexOutOfBoundsException: Index: 20, Size: 20</span> </div>
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+String script = URLEncoder.encode("request.body * 2", "UTF-8");
+from("direct:start").to("language:groovy:" + script).to("mock:result");
+]]></script>
+</div></div>
 
 <p>You can also provide the script as a header as shown below. Here we use <a shape="rect" href="xpath.html" title="XPath">XPath</a> language to extract the text from the <tt>&lt;foo&gt;</tt> tag.</p>
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
@@ -10326,14 +10394,35 @@ assertEquals("Hello World", out);
 The uri must start with one of the following schemes: <a shape="rect" class="external-link" href="file:" rel="nofollow">file:</a>, classpath:, or http:</p>
 
 <p>For example to load a script from the classpath:</p>
-<div class="error"><span class="error">Error formatting macro: snippet: java.lang.IndexOutOfBoundsException: Index: 20, Size: 20</span> </div>
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+from("direct:start")
+    // load the script from the classpath
+    .to("language:simple:classpath:org/apache/camel/component/language/mysimplescript.txt")
+    .to("mock:result");
+]]></script>
+</div></div>
 
 <p>By default the script is loaded once and cached. However you can disable the <tt>contentCache</tt> option and have the script loaded on each evaluation.<br clear="none">
 For example if the file myscript.txt is changed on disk, then the updated script is used:</p>
-<div class="error"><span class="error">Error formatting macro: snippet: java.lang.IndexOutOfBoundsException: Index: 20, Size: 20</span> </div>
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+from("direct:start")
+    // the script will be loaded on each message, as we disabled cache
+    .to("language:simple:file:target/script/myscript.txt?contentCache=false")
+    .to("mock:result");
+]]></script>
+</div></div>
 
 <p>From <b>Camel 2.11</b> onwards you can refer to the resource similar to the other <a shape="rect" href="language.html" title="Language">Language</a>s in Camel by prefixing with <tt>"resource:"</tt> as shown below:</p>
-<div class="error"><span class="error">Error formatting macro: snippet: java.lang.IndexOutOfBoundsException: Index: 20, Size: 20</span> </div>
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+from("direct:start")
+    // load the script from the classpath
+    .to("language:simple:resource:classpath:org/apache/camel/component/language/mysimplescript.txt")
+    .to("mock:result");
+]]></script>
+</div></div>
 
 
 <h3><a shape="rect" name="BookComponentAppendix-SeeAlso"></a>See Also</h3>
@@ -10948,10 +11037,24 @@ from(...)
 <p>Camel copies all of the exchange's IN headers to the <a shape="rect" class="external-link" href="http://java.sun.com/javaee/5/docs/api/javax/mail/internet/MimeMessage.html" rel="nofollow">MimeMessage</a> headers.</p>
 
 <p>The subject of the <a shape="rect" class="external-link" href="http://java.sun.com/javaee/5/docs/api/javax/mail/internet/MimeMessage.html" rel="nofollow">MimeMessage</a> can be configured using a header property on the IN message. The code below demonstrates this:</p>
-<div class="error"><span class="error">Error formatting macro: snippet: java.lang.IndexOutOfBoundsException: Index: 20, Size: 20</span> </div>
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+from("direct:a").setHeader("subject", constant(subject)).to("smtp://james2@localhost");
+]]></script>
+</div></div>
 
 <p>The same applies for other MimeMessage headers such as recipients, so you can use a header property as <tt>To</tt>:</p>
-<div class="error"><span class="error">Error formatting macro: snippet: java.lang.IndexOutOfBoundsException: Index: 20, Size: 20</span> </div>
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+Map&lt;String, Object&gt; map = new HashMap&lt;String, Object&gt;();
+map.put("To", "davsclaus@apache.org");
+map.put("From", "jstrachan@apache.org");
+map.put("Subject", "Camel rocks");
+
+String body = "Hello Claus.\nYes it does.\n\nRegards James.";
+template.sendBodyAndHeaders("smtp://davsclaus@apache.org", body, map);
+]]></script>
+</div></div>
 
 <p><b>Since Camel 2.11</b> When using the MailProducer the send the mail to server, you should be able to get the message id of the <a shape="rect" class="external-link" href="http://java.sun.com/javaee/5/docs/api/javax/mail/internet/MimeMessage.html" rel="nofollow">MimeMessage</a> with the key <tt>CamelMailMessageId</tt> from the Camel message header.</p>
 
@@ -11026,14 +11129,44 @@ from("imap://admin@mymailserver.com
 </div></div>
 
 <p>In this sample we want to send a mail to multiple recipients: </p>
-<div class="error"><span class="error">Error formatting macro: snippet: java.lang.IndexOutOfBoundsException: Index: 20, Size: 20</span> </div>
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+// all the recipients of this mail are:
+// To: camel@riders.org , easy@riders.org
+// CC: me@you.org
+// BCC: someone@somewhere.org
+String recipients = "&amp;To=camel@riders.org,easy@riders.org&amp;CC=me@you.org&amp;BCC=someone@somewhere.org";
+
+from("direct:a").to("smtp://you@mymailserver.com?password=secret&amp;From=you@apache.org" + recipients);
+]]></script>
+</div></div>
 
 <h3><a shape="rect" name="BookComponentAppendix-Sendingmailwithattachmentsample"></a>Sending mail with attachment sample</h3>
 
 <div class="panelMacro"><table class="warningMacro"><colgroup span="1"><col span="1" width="24"><col span="1"></colgroup><tr><td colspan="1" rowspan="1" valign="top"><img align="middle" src="https://cwiki.apache.org/confluence/images/icons/emoticons/forbidden.gif" width="16" height="16" alt="" border="0"></td><td colspan="1" rowspan="1"><b>Attachments are not support by all Camel components</b><br clear="none">The <em>Attachments API</em> is based on the Java Activation Framework and is generally only used by the Mail API. Since many of the other Camel components do not support attachments, the attachments could potentially be lost as they propagate along the route. The rule of thumb, therefore, is to add attachments just before sending a message to the mail endpoint.</td></tr></table></div>
 
 <p>The mail component supports attachments. In the sample below, we send a mail message containing a plain text message with a logo file attachment.</p>
-<div class="error"><span class="error">Error formatting macro: snippet: java.lang.IndexOutOfBoundsException: Index: 20, Size: 20</span> </div>
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+
+// create an exchange with a normal body and attachment to be produced as email
+Endpoint endpoint = context.getEndpoint("smtp://james@mymailserver.com?password=secret");
+
+// create the exchange with the mail message that is multipart with a file and a Hello World text/plain message.
+Exchange exchange = endpoint.createExchange();
+Message in = exchange.getIn();
+in.setBody("Hello World");
+in.addAttachment("logo.jpeg", new DataHandler(new FileDataSource("src/test/data/logo.jpeg")));
+
+// create a producer that can produce the exchange (= send the mail)
+Producer producer = endpoint.createProducer();
+// start the producer
+producer.start();
+// and let it go (processes the exchange by sending the email)
+producer.process(exchange);
+
+]]></script>
+</div></div>
 
 <h3><a shape="rect" name="BookComponentAppendix-SSLsample"></a>SSL sample</h3>
 
@@ -11104,7 +11237,17 @@ from("imaps://imap.gmail.com?username=YO
 <p>The code is provided out of the box in Camel 2.10 onwards in the <tt>camel-mail</tt> component. The code is in the class: <tt>org.apache.camel.component.mail.SplitAttachmentsExpression</tt>, which you can find the source code <a shape="rect" class="external-link" href="https://svn.apache.org/repos/asf/camel/trunk/components/camel-mail/src/main/java/org/apache/camel/component/mail/SplitAttachmentsExpression.java">here</a></p>
 
 <p>In the Camel route you then need to use this <a shape="rect" href="expression.html" title="Expression">Expression</a> in the route as shown below:</p>
-<div class="error"><span class="error">Error formatting macro: snippet: java.lang.IndexOutOfBoundsException: Index: 20, Size: 20</span> </div>
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+from("pop3://james@mymailserver.com?password=secret&amp;consumer.delay=1000")
+    .to("log:email")
+    // use the SplitAttachmentsExpression which will split the message per attachment
+    .split(new SplitAttachmentsExpression())
+        // each message going to this mock has a single attachment
+        .to("mock:split")
+    .end();
+]]></script>
+</div></div>
 
 <p>If you use XML DSL then you need to declare a method call expression in the <a shape="rect" href="splitter.html" title="Splitter">Splitter</a> as shown below</p>
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
@@ -11258,7 +11401,11 @@ However, the option, <b>transferExchange
 
 <p>In this sample, Camel exposes a service that listens for TCP connections on port 6200. We use the <b>textline</b> codec. In our route, we create a Mina consumer endpoint that listens on port 6200:</p>
 
-<div class="error"><span class="error">Error formatting macro: snippet: java.lang.IndexOutOfBoundsException: Index: 20, Size: 20</span> </div>
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+from("mina:tcp://localhost:" + port1 + "?textline=true&amp;sync=false").to("mock:result");
+]]></script>
+</div></div>
 
 <p>As the sample is part of a unit test, we test it by sending some data to it on port 6200.</p>
 
@@ -14050,7 +14197,37 @@ from("direct:start")
 <p><b>Available as of Camel 2.7</b></p>
 
 <p>Camel supports <a shape="rect" href="using-osgi-blueprint-with-camel.html" title="Using OSGi blueprint with Camel">Blueprint</a> which also offers a property placeholder service. Camel supports convention over configuration, so all you have to do is to define the OSGi Blueprint property placeholder in the XML file as shown below:</p>
-<div class="error"><span class="error">Error formatting macro: snippet: java.lang.IndexOutOfBoundsException: Index: 20, Size: 20</span> </div>
+<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader" style="border-bottom-width: 1px;"><b>Using OSGi blueprint property placeholders in Camel routes</b></div><div class="codeContent panelContent">
+<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[
+&lt;blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+           xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0"
+           xsi:schemaLocation="
+           http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd"&gt;
+
+    &lt;!-- OSGI blueprint property placeholder --&gt;
+    &lt;cm:property-placeholder id="myblueprint.placeholder" persistent-id="camel.blueprint"&gt;
+        &lt;!-- list some properties for this test --&gt;
+        &lt;cm:default-properties&gt;
+            &lt;cm:property name="result" value="mock:result"/&gt;
+        &lt;/cm:default-properties&gt;
+    &lt;/cm:property-placeholder&gt;
+
+    &lt;camelContext xmlns="http://camel.apache.org/schema/blueprint"&gt;
+
+        &lt;!-- in the route we can use {{ }} placeholders which will lookup in blueprint
+             as Camel will auto detect the OSGi blueprint property placeholder and use it --&gt;
+        &lt;route&gt;
+            &lt;from uri="direct:start"/&gt;
+            &lt;to uri="mock:foo"/&gt;
+            &lt;to uri="{{result}}"/&gt;
+        &lt;/route&gt;
+
+    &lt;/camelContext&gt;
+
+&lt;/blueprint&gt;
+]]></script>
+</div></div>
 
 <p>By default Camel detects and uses OSGi blueprint property placeholder service. You can disable this by setting the attribute <tt>useBlueprintPropertyResolver</tt> to false on the <tt>&lt;camelContext&gt;</tt> definition.</p>
 
@@ -14109,12 +14286,48 @@ location="blueprint:myblueprint.placehol
 <p><b>Available as of Camel 2.10.4</b></p>
 
 <p>When using Blueprint property placeholder in the Blueprint XML file, you can declare the properties directly in the XML file as shown below:</p>
-<div class="error"><span class="error">Error formatting macro: snippet: java.lang.IndexOutOfBoundsException: Index: 20, Size: 20</span> </div>
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[
+&lt;!-- blueprint property placeholders --&gt;
+&lt;cm:property-placeholder persistent-id="my-placeholders"&gt;
+  &lt;cm:default-properties&gt;
+    &lt;cm:property name="greeting" value="Hello"/&gt;
+    &lt;cm:property name="destination" value="mock:result"/&gt;
+  &lt;/cm:default-properties&gt;
+&lt;/cm:property-placeholder&gt;
+
+&lt;!-- a bean that uses a blueprint property placeholder --&gt;
+&lt;bean id="myCoolBean" class="org.apache.camel.test.blueprint.MyCoolBean"&gt;
+  &lt;property name="say" value="${greeting}"/&gt;
+&lt;/bean&gt;
+
+&lt;camelContext xmlns="http://camel.apache.org/schema/blueprint"&gt;
+
+  &lt;route&gt;
+    &lt;from uri="direct:start"/&gt;
+    &lt;bean ref="myCoolBean" method="saySomething"/&gt;
+    &lt;to uri="{{destination}}"/&gt;
+  &lt;/route&gt;
+
+&lt;/camelContext&gt;
+]]></script>
+</div></div>
 
 <p>Notice that we have a &lt;bean&gt; which refers to one of the properties. And in the Camel route we refer to the other using the {{ }} notation.</p>
 
 <p>Now if you want to override these Blueprint properties from an unit test, you can do this as shown below:</p>
-<div class="error"><span class="error">Error formatting macro: snippet: java.lang.IndexOutOfBoundsException: Index: 20, Size: 20</span> </div>
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+@Override
+protected String useOverridePropertiesWithConfigAdmin(Dictionary props) {
+    // add the properties we want to override
+    props.put("greeting", "Bye");
+
+    // return the PID of the config-admin we are using in the blueprint xml file
+    return "my-placeholders";
+}
+]]></script>
+</div></div>
 
 <p>To do this we override and implement the <tt>useOverridePropertiesWithConfigAdmin</tt> method. We can then put the properties we want to override on the given props parameter. And the return value <b>must</b> be the persistence-id of the &lt;cm:property-placeholder&gt; tag, which you define in the blueprint XML file.</p>
 
@@ -14124,10 +14337,39 @@ location="blueprint:myblueprint.placehol
 <p>When using Blueprint property placeholder in the Blueprint XML file, you can declare the properties in a .properties or .cfg file. If you use Apache ServieMix / Karaf then this container has a convention that it loads the properties from a file in the etc directory with the naming etc/pid.cfg, where pid is the persistence-id.</p>
 
 <p>For example in the blueprint XML file we have the persistence-id="stuff", which mean it will load the configuration file as etc/stuff.cfg.</p>
-<div class="error"><span class="error">Error formatting macro: snippet: java.lang.IndexOutOfBoundsException: Index: 20, Size: 20</span> </div>
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[
+&lt;!-- blueprint property placeholders, that will use etc/stuff.cfg as the properties file --&gt;
+&lt;cm:property-placeholder persistent-id="stuff"/&gt;
+
+&lt;!-- a bean that uses a blueprint property placeholder --&gt;
+&lt;bean id="myCoolBean" class="org.apache.camel.test.blueprint.MyCoolBean"&gt;
+  &lt;property name="say" value="${greeting}"/&gt;
+&lt;/bean&gt;
+
+&lt;camelContext xmlns="http://camel.apache.org/schema/blueprint"&gt;
+
+  &lt;route&gt;
+    &lt;from uri="direct:start"/&gt;
+    &lt;bean ref="myCoolBean" method="saySomething"/&gt;
+    &lt;to uri="mock:result"/&gt;
+  &lt;/route&gt;
+
+&lt;/camelContext&gt;
+]]></script>
+</div></div>
 
 <p>Now if you want to unit test this blueprint XML file, then you can override the <tt>loadConfigAdminConfigurationFile</tt> and tell Camel which file to load as shown below:</p>
-<div class="error"><span class="error">Error formatting macro: snippet: java.lang.IndexOutOfBoundsException: Index: 20, Size: 20</span> </div>
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+@Override
+protected String[] loadConfigAdminConfigurationFile() {
+    // String[0] = tell Camel the path of the .cfg file to use for OSGi ConfigAdmin in the blueprint XML file
+    // String[1] = tell Camel the persistence-id of the cm:property-placeholder in the blueprint XML file
+    return new String[]{"src/test/resources/etc/stuff.cfg", "stuff"};
+}
+]]></script>
+</div></div>
 
 <p>Notice that this method requires to return a String[] with 2 values. The 1st value is the path for the configuration file to load.<br clear="none">
 The 2nd value is the persistence-id of the &lt;cm:property-placeholder&gt; tag.</p>
@@ -14144,10 +14386,83 @@ greeting=Bye
 <h4><a shape="rect" name="BookComponentAppendix-Using.cfgfileandoverridingpropertiesforBlueprintpropertyplaceholders"></a>Using .cfg file and overriding properties for Blueprint property placeholders</h4>
 
 <p>You can do both as well. Here is a complete example. First we have the Blueprint XML file:</p>
-<div class="error"><span class="error">Error formatting macro: snippet: java.lang.IndexOutOfBoundsException: Index: 20, Size: 20</span> </div>
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[
+&lt;blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+           xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0"
+           xsi:schemaLocation="
+             http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0 http://aries.apache.org/schemas/blueprint-cm/blueprint-cm-1.0.0.xsd
+             http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd"&gt;
+
+  &lt;!-- blueprint property placeholders, that will use etc/stuff.cfg as the properties file --&gt;
+  &lt;cm:property-placeholder persistent-id="stuff"/&gt;
+
+  &lt;!-- a bean that uses a blueprint property placeholder --&gt;
+  &lt;bean id="myCoolBean" class="org.apache.camel.test.blueprint.MyCoolBean"&gt;
+    &lt;property name="say" value="${greeting}"/&gt;
+    &lt;property name="echo" value="${echo}"/&gt;
+  &lt;/bean&gt;
+
+  &lt;camelContext xmlns="http://camel.apache.org/schema/blueprint"&gt;
+
+    &lt;route&gt;
+      &lt;from uri="direct:start"/&gt;
+      &lt;bean ref="myCoolBean" method="saySomething"/&gt;
+      &lt;to uri="{{destination}}"/&gt;
+      &lt;bean ref="myCoolBean" method="echoSomething"/&gt;
+      &lt;to uri="{{destination}}"/&gt;
+    &lt;/route&gt;
+
+  &lt;/camelContext&gt;
+
+&lt;/blueprint&gt;
+]]></script>
+</div></div>
 
 <p>And in the unit test class we do as follows:</p>
-<div class="error"><span class="error">Error formatting macro: snippet: java.lang.IndexOutOfBoundsException: Index: 20, Size: 20</span> </div>
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+/**
+ * This example will load a Blueprint .cfdg file, and also override its property placeholders from this unit test
+ * source code directly.
+ */
+public class ConfigAdminLoadConfigurationFileAndOverrideTest extends CamelBlueprintTestSupport {
+
+    @Override
+    protected String getBlueprintDescriptor() {
+        // which blueprint XML file to use for this test
+        return "org/apache/camel/test/blueprint/configadmin-loadfileoverride.xml";
+    }
+
+    @Override
+    protected String[] loadConfigAdminConfigurationFile() {
+        // which .cfg file to use, and the name of the persistence-id
+        return new String[]{"src/test/resources/etc/stuff.cfg", "stuff"};
+    }
+
+    @Override
+    protected String useOverridePropertiesWithConfigAdmin(Dictionary props) throws Exception {
+        // override / add extra properties
+        props.put("destination", "mock:extra");
+
+        // return the persistence-id to use
+        return "stuff";
+    }
+
+    @Test
+    public void testConfigAdmin() throws Exception {
+        // regular unit test method
+        getMockEndpoint("mock:extra").expectedBodiesReceived("Bye World", "Yay Bye WorldYay Bye World");
+
+        template.sendBody("direct:start", "World");
+
+        assertMockEndpointsSatisfied();
+    }
+
+}
+]]></script>
+</div></div>
 
 <p>And the <tt>etc/stuff.cfg</tt> configuration file contains</p>
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
@@ -14165,12 +14480,41 @@ destination=mock:result
 <p>The Spring Framework does not allow 3rd party frameworks such as Apache Camel to seamless hook into the Spring property placeholder mechanism. However you can easily bridge Spring and Camel by declaring a Spring bean with the type <tt>org.apache.camel.spring.spi.BridgePropertyPlaceholderConfigurer</tt>, which is a Spring <tt>org.springframework.beans.factory.config.PropertyPlaceholderConfigurer</tt> type. </p>
 
 <p>To bridge Spring and Camel you must define a single bean as shown below:</p>
-<div class="error"><span class="error">Error formatting macro: snippet: java.lang.IndexOutOfBoundsException: Index: 20, Size: 20</span> </div>
+<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader" style="border-bottom-width: 1px;"><b>Bridging Spring and Camel property placeholders</b></div><div class="codeContent panelContent">
+<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[
+
+&lt;!-- bridge spring property placeholder with Camel --&gt;
+&lt;!-- you must NOT use the &lt;context:property-placeholder at the same time, only this bridge bean --&gt;
+&lt;bean id="bridgePropertyPlaceholder" class="org.apache.camel.spring.spi.BridgePropertyPlaceholderConfigurer"&gt;
+  &lt;property name="location" value="classpath:org/apache/camel/component/properties/cheese.properties"/&gt;
+&lt;/bean&gt;
+
+]]></script>
+</div></div>
 
 <p>You <b>must not</b> use the spring &lt;context:property-placeholder&gt; namespace at the same time; this is not possible.</p>
 
 <p>After declaring this bean, you can define property placeholders using both the Spring style, and the Camel style within the &lt;camelContext&gt; tag as shown below:</p>
-<div class="error"><span class="error">Error formatting macro: snippet: java.lang.IndexOutOfBoundsException: Index: 20, Size: 20</span> </div>
+<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader" style="border-bottom-width: 1px;"><b>Using bridge property placeholders</b></div><div class="codeContent panelContent">
+<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[
+
+&lt;!-- a bean that uses Spring property placeholder --&gt;
+&lt;!-- the ${hi} is a spring property placeholder --&gt;
+&lt;bean id="hello" class="org.apache.camel.component.properties.HelloBean"&gt;
+  &lt;property name="greeting" value="${hi}"/&gt;
+&lt;/bean&gt;
+
+&lt;camelContext xmlns="http://camel.apache.org/schema/spring"&gt;
+  &lt;!-- in this route we use Camels property placeholder {{ }} style --&gt;
+  &lt;route&gt;
+    &lt;from uri="direct:{{cool.bar}}"/&gt;
+    &lt;bean ref="hello"/&gt;
+    &lt;to uri="{{cool.end}}"/&gt;
+  &lt;/route&gt;
+&lt;/camelContext&gt;
+
+]]></script>
+</div></div>
 
 <p>Notice how the hello bean is using pure Spring property placeholders using the ${ } notation. And in the Camel routes we use the Camel placeholder notation with {{ }}.</p>
 
@@ -14204,7 +14548,18 @@ This is now possible from Camel 2.10 onw
 
 
 <p>So for example in your unit test classes, you can override the <tt>useOverridePropertiesWithPropertiesComponent</tt> method and return a <tt>java.util.Properties</tt> that contains the properties which should be preferred to be used.</p>
-<div class="error"><span class="error">Error formatting macro: snippet: java.lang.IndexOutOfBoundsException: Index: 20, Size: 20</span> </div>
+<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader" style="border-bottom-width: 1px;"><b>Providing properties from within unit test source</b></div><div class="codeContent panelContent">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+// override this method to provide our custom properties we use in this unit test
+@Override
+protected Properties useOverridePropertiesWithPropertiesComponent() {
+    Properties extra = new Properties();
+    extra.put("destination", "mock:extra");
+    extra.put("greeting", "Bye");
+    return extra;
+}
+]]></script>
+</div></div>
 
 <p>This can be done from any of the Camel Test kits, such as camel-test, camel-test-spring, and camel-test-blueprint.</p>
 
@@ -14261,7 +14616,24 @@ ref:someName
 <h3><a shape="rect" name="BookComponentAppendix-Sample"></a>Sample</h3>
 <p>In the sample below we use the <tt>ref:</tt> in the URI to reference the endpoint with the spring ID, <tt>endpoint2</tt>:</p>
 
-<div class="error"><span class="error">Error formatting macro: snippet: java.lang.IndexOutOfBoundsException: Index: 20, Size: 20</span> </div>
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[
+&lt;bean id="mybean" class="org.apache.camel.spring.example.DummyBean"&gt;
+  &lt;property name="endpoint" ref="endpoint1"/&gt;
+&lt;/bean&gt;
+
+&lt;camelContext id="camel" xmlns="http://camel.apache.org/schema/spring"&gt;
+  &lt;jmxAgent id="agent" disabled="true"/&gt;
+  &lt;endpoint id="endpoint1" uri="direct:start"/&gt;
+  &lt;endpoint id="endpoint2" uri="mock:end"/&gt;
+
+  &lt;route&gt;
+    &lt;from ref="endpoint1"/&gt;
+    &lt;to uri="ref:endpoint2"/&gt;
+  &lt;/route&gt;
+&lt;/camelContext&gt;
+]]></script>
+</div></div>
 
 <p>You could, of course, have used the <tt>ref</tt> attribute instead:</p>
 
@@ -14351,12 +14723,38 @@ from("restlet:http://localhost:" + port 
 ]]></script>
 </div></div>
 <p>The <tt>restletRealm</tt> setting in the URI query is used to look up a Realm Map in the registry.  If this option is specified, the restlet consumer uses the information to authenticate user logins.  Only <em>authenticated</em> requests can access the resources.  In this sample, we create a Spring application context that serves as a registry.  The bean ID of the Realm Map should match the <em>restletRealmRef</em>.</p>
-<div class="error"><span class="error">Error formatting macro: snippet: java.lang.IndexOutOfBoundsException: Index: 20, Size: 20</span> </div>
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[
+&lt;util:map id="realm"&gt;
+	&lt;entry key="admin" value="foo" /&gt;
+	&lt;entry key="bar" value="foo" /&gt;
+&lt;/util:map&gt;
+]]></script>
+</div></div>
 <p>The following sample starts a <tt>direct</tt> endpoint that sends requests to the server on <a shape="rect" class="external-link" href="http://localhost:8080" rel="nofollow">http://localhost:8080</a> (that is, our restlet consumer endpoint).</p>
-<div class="error"><span class="error">Error formatting macro: snippet: java.lang.IndexOutOfBoundsException: Index: 20, Size: 20</span> </div>
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+// Note: restletMethod and restletRealmRef are stripped 
+// from the query before a request is sent as they are 
+// only processed by Camel.
+from("direct:start-auth").to("restlet:http://localhost:" + port + "/securedOrders?restletMethod=post");
+]]></script>
+</div></div>
 <p>That is all we need.  We are ready to send a request and try out the restlet component:</p>
 
-<div class="error"><span class="error">Error formatting macro: snippet: java.lang.IndexOutOfBoundsException: Index: 20, Size: 20</span> </div>
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+final String id = "89531";
+
+Map&lt;String, Object&gt; headers = new HashMap&lt;String, Object&gt;();
+headers.put(RestletConstants.RESTLET_LOGIN, "admin");
+headers.put(RestletConstants.RESTLET_PASSWORD, "foo");
+headers.put("id", id);
+
+String response = (String)template.requestBodyAndHeaders(
+    "direct:start-auth", "&lt;order foo='1'/&gt;", headers);
+]]></script>
+</div></div>
 
 <p>The sample client sends a request to the <tt>direct:start-auth</tt> endpoint with the following headers:</p>
 <ul><li><tt>CamelRestletLogin</tt> (used internally by Camel)</li><li><tt>CamelRestletPassword</tt> (used internally by Camel)</li><li><tt>id</tt> (application header)</li></ul>
@@ -14374,11 +14772,38 @@ received [&lt;order foo='1'/&gt;] as an 
 <h4><a shape="rect" name="BookComponentAppendix-SinglerestletendpointtoservicemultiplemethodsandURItemplates"></a>Single restlet endpoint to service multiple methods and URI templates</h4>
 
 <p>It is possible to create a single route to service multiple HTTP methods using the <tt>restletMethods</tt> option.  This snippet also shows how to retrieve the request method from the header:</p>
-<div class="error"><span class="error">Error formatting macro: snippet: java.lang.IndexOutOfBoundsException: Index: 20, Size: 20</span> </div>
-
-<p>In addition to servicing multiple methods, the next snippet shows how to create an endpoint that supports multiple URI templates using the <tt>restletUriPatterns</tt> option.  The request URI is available in the header of the IN message as well.  If a URI pattern has been defined in the endpoint URI (which is not the case in this sample), both the URI pattern defined in the endpoint and the <tt>restletUriPatterns</tt> option will be honored.</p>
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+from("restlet:http://localhost:" + portNum + "/users/{username}?restletMethods=post,get,put")
+    .process(new Processor() {
+        public void process(Exchange exchange) throws Exception {
+            // echo the method
+            exchange.getOut().setBody(exchange.getIn().getHeader(Exchange.HTTP_METHOD, String.class));
+        }
+    });
+]]></script>
+</div></div>
 
-<div class="error"><span class="error">Error formatting macro: snippet: java.lang.IndexOutOfBoundsException: Index: 20, Size: 20</span> </div>
+<p>In addition to servicing multiple methods, the next snippet shows how to create an endpoint that supports multiple URI templates using the <tt>restletUriPatterns</tt> option.  The request URI is available in the header of the IN message as well.  If a URI pattern has been defined in the endpoint URI (which is not the case in this sample), both the URI pattern defined in the endpoint and the <tt>restletUriPatterns</tt> option will be honored.</p>
+
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+from("restlet:http://localhost:" + portNum + "?restletMethods=post,get&amp;restletUriPatterns=#uriTemplates")
+    .process(new Processor() {
+        public void process(Exchange exchange) throws Exception {
+            // echo the method
+            String uri = exchange.getIn().getHeader(Exchange.HTTP_URI, String.class);
+            String out = exchange.getIn().getHeader(Exchange.HTTP_METHOD, String.class);
+            if (("http://localhost:" + portNum + "/users/homer").equals(uri)) {
+                exchange.getOut().setBody(out + " " + exchange.getIn().getHeader("username", String.class));
+            } else if (("http://localhost:" + portNum + "/atom/collection/foo/component/bar").equals(uri)) {
+                exchange.getOut().setBody(out + " " + exchange.getIn().getHeader("id", String.class)
+                                          + " " + exchange.getIn().getHeader("cid", String.class));
+            }
+        }
+    });
+]]></script>
+</div></div>
 
 <p>The <tt>restletUriPatterns=#uriTemplates</tt> option references the <tt>List&lt;String&gt;</tt> bean defined in the Spring XML configuration.</p>
 
@@ -14670,11 +15095,26 @@ from("rss:file:src/test/data/rss20.xml?s
 
 <p>You can filter out entries quite easily using XPath, as shown in the data format section above. You can also exploit Camel's <a shape="rect" href="bean-integration.html" title="Bean Integration">Bean Integration</a> to implement your own conditions. For instance, a filter equivalent to the XPath example above would be:</p>
 
-<div class="error"><span class="error">Error formatting macro: snippet: java.lang.IndexOutOfBoundsException: Index: 20, Size: 20</span> </div>
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+// only entries with Camel in the title will get through the filter
+from("rss:file:src/test/data/rss20.xml?splitEntries=true&amp;consumer.delay=100").
+    filter().method("myFilterBean", "titleContainsCamel").to("mock:result");
+]]></script>
+</div></div>
 
 <p>The custom bean for this would be:</p>
 
-<div class="error"><span class="error">Error formatting macro: snippet: java.lang.IndexOutOfBoundsException: Index: 20, Size: 20</span> </div>
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+public static class FilterBean {
+    public boolean titleContainsCamel(@Body SyndFeed feed) {
+        SyndEntry firstEntry = (SyndEntry) feed.getEntries().get(0);
+        return firstEntry.getTitle().contains("Camel");
+    }
+}
+]]></script>
+</div></div>
 
 <h3><a shape="rect" name="BookComponentAppendix-SeeAlso"></a>See Also</h3>
 <ul><li><a shape="rect" href="configuring-camel.html" title="Configuring Camel">Configuring Camel</a></li><li><a shape="rect" href="component.html" title="Component">Component</a></li><li><a shape="rect" href="endpoint.html" title="Endpoint">Endpoint</a></li><li><a shape="rect" href="getting-started.html" title="Getting Started">Getting Started</a></li></ul>
@@ -14956,10 +15396,47 @@ servlet://relative_path[?options]
 <p>In this sample, we define a route that exposes a HTTP service at <tt><a shape="rect" class="external-link" href="http://localhost:8080/camel/services/hello" rel="nofollow">http://localhost:8080/camel/services/hello</a></tt>.<br clear="none">
 First, you need to publish the <a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/camel/trunk/components/camel-servlet/src/main/java/org/apache/camel/component/servlet/CamelHttpTransportServlet.java">CamelHttpTransportServlet</a> through the normal Web Container, or OSGi Service.<br clear="none">
 Use the <tt>Web.xml</tt> file to publish the <a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/camel/trunk/components/camel-servlet/src/main/java/org/apache/camel/component/servlet/CamelHttpTransportServlet.java">CamelHttpTransportServlet</a> as follows:</p>
-<div class="error"><span class="error">Error formatting macro: snippet: java.lang.IndexOutOfBoundsException: Index: 20, Size: 20</span> </div>
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[
+&lt;web-app&gt;
+
+  &lt;servlet&gt;
+    &lt;servlet-name&gt;CamelServlet&lt;/servlet-name&gt;
+    &lt;display-name&gt;Camel Http Transport Servlet&lt;/display-name&gt;
+    &lt;servlet-class&gt;org.apache.camel.component.servlet.CamelHttpTransportServlet&lt;/servlet-class&gt;
+  &lt;/servlet&gt;
+
+  &lt;servlet-mapping&gt;
+    &lt;servlet-name&gt;CamelServlet&lt;/servlet-name&gt;
+    &lt;url-pattern&gt;/services/*&lt;/url-pattern&gt;
+  &lt;/servlet-mapping&gt;
+
+&lt;/web-app&gt;
+]]></script>
+</div></div>
 
 <p>Then you can define your route as follows:</p>
-<div class="error"><span class="error">Error formatting macro: snippet: java.lang.IndexOutOfBoundsException: Index: 20, Size: 20</span> </div>
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+from("servlet:///hello?matchOnUriPrefix=true").process(new Processor() {
+    public void process(Exchange exchange) throws Exception {
+        String contentType = exchange.getIn().getHeader(Exchange.CONTENT_TYPE, String.class);
+        String path = exchange.getIn().getHeader(Exchange.HTTP_URI, String.class);
+        path = path.substring(path.lastIndexOf("/"));
+
+        assertEquals("Get a wrong content type", CONTENT_TYPE, contentType);
+        // assert camel http header
+        String charsetEncoding = exchange.getIn().getHeader(Exchange.HTTP_CHARACTER_ENCODING, String.class);
+        assertEquals("Get a wrong charset name from the message heaer", "UTF-8", charsetEncoding);
+        // assert exchange charset
+        assertEquals("Get a wrong charset naem from the exchange property", "UTF-8", exchange.getProperty(Exchange.CHARSET_NAME));
+        exchange.getOut().setHeader(Exchange.CONTENT_TYPE, contentType + "; charset=UTF-8");
+        exchange.getOut().setHeader("PATH", path);
+        exchange.getOut().setBody("&lt;b&gt;Hello World&lt;/b&gt;");
+    }
+});
+]]></script>
+</div></div>
 
 <div class="panelMacro"><table class="noteMacro"><colgroup span="1"><col span="1" width="24"><col span="1"></colgroup><tr><td colspan="1" rowspan="1" valign="top"><img align="middle" src="https://cwiki.apache.org/confluence/images/icons/emoticons/warning.gif" width="16" height="16" alt="" border="0"></td><td colspan="1" rowspan="1"><b>Specify the relative path for camel-servlet endpoint</b><br clear="none">Since we are binding the Http transport with a published servlet, and we don't know the servlet's application context path, the <tt>camel-servlet</tt> endpoint uses the relative path to specify the endpoint's URL. A client can access the <tt>camel-servlet</tt> endpoint through the servlet publish address: <tt>("http://localhost:8080/camel/services") + RELATIVE_PATH("/hello")</tt>.</td></tr></table></div>
 
@@ -14995,13 +15472,156 @@ Use the <tt>Web.xml</tt> file to publish
 <h4><a shape="rect" name="BookComponentAppendix-SamplewhenusingOSGi"></a>Sample when using OSGi</h4>
 
 <p>From <b>Camel 2.6.0</b>, you can publish the <a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/camel/trunk/components/camel-servlet/src/main/java/org/apache/camel/component/servlet/CamelHttpTransportServlet.java">CamelHttpTransportServlet</a> as an OSGi service with help of SpringDM like this.</p>
-<div class="error"><span class="error">Error formatting macro: snippet: java.lang.IndexOutOfBoundsException: Index: 20, Size: 20</span> </div>
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[
+&lt;beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:osgi="http://www.springframework.org/schema/osgi"
+       xsi:schemaLocation="
+       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+       http://www.springframework.org/schema/osgi  http://www.springframework.org/schema/osgi/spring-osgi.xsd"&gt;
+    
+    &lt;bean id="camelServlet" class="org.apache.camel.component.servlet.CamelHttpTransportServlet"&gt;
+    &lt;/bean&gt;
+    
+    &lt;!-- 
+    	Enlist it in OSGi service registry 
+    	This will cause two things:
+    	1) As the pax web whiteboard extender is running the CamelServlet will
+    	   be registered with the OSGi HTTP Service
+    	2) It will trigger the HttpRegistry in other bundles so the servlet is
+    	   made known there too
+    --&gt;
+    &lt;osgi:service ref="camelServlet"&gt;
+    	&lt;osgi:interfaces&gt;
+    		&lt;value&gt;javax.servlet.Servlet&lt;/value&gt;
+    		&lt;value&gt;org.apache.camel.component.http.CamelServlet&lt;/value&gt;
+    	&lt;/osgi:interfaces&gt;
+        &lt;osgi:service-properties&gt;
+            &lt;entry key="alias" value="/camel/services" /&gt;
+            &lt;entry key="matchOnUriPrefix" value="true" /&gt;
+            &lt;entry key="servlet-name" value="CamelServlet"/&gt;
+        &lt;/osgi:service-properties&gt;
+    &lt;/osgi:service&gt;
+
+&lt;/beans&gt;
+]]></script>
+</div></div>
 
 <p>Then use this service in your camel route like this:</p>
-<div class="error"><span class="error">Error formatting macro: snippet: java.lang.IndexOutOfBoundsException: Index: 20, Size: 20</span> </div>
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[
+&lt;beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:camel="http://camel.apache.org/schema/spring"
+       xmlns:osgi="http://www.springframework.org/schema/osgi"
+       xsi:schemaLocation="
+       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+       http://www.springframework.org/schema/osgi  http://www.springframework.org/schema/osgi/spring-osgi.xsd
+       http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd"&gt;
+
+	&lt;osgi:reference id="servletref" interface="org.apache.camel.component.http.CamelServlet"&gt;
+  		&lt;osgi:listener bind-method="register" unbind-method="unregister"&gt;
+     		&lt;ref bean="httpRegistry"/&gt;
+  		&lt;/osgi:listener&gt;
+	&lt;/osgi:reference&gt;
+	
+	&lt;bean id="httpRegistry" class="org.apache.camel.component.servlet.DefaultHttpRegistry"/&gt;
+        
+	&lt;bean id="servlet" class="org.apache.camel.component.servlet.ServletComponent"&gt;
+    	&lt;property name="httpRegistry" ref="httpRegistry" /&gt;
+	&lt;/bean&gt;
+
+	&lt;bean id="servletProcessor" class="org.apache.camel.itest.osgi.servlet.ServletProcessor" /&gt;
+
+    &lt;camelContext xmlns="http://camel.apache.org/schema/spring"&gt;
+        &lt;route&gt;
+            &lt;!-- notice how we can use the servlet scheme which is that osgi:reference above --&gt;
+            &lt;from uri="servlet:///hello"/&gt;
+            &lt;process ref="servletProcessor"/&gt;
+        &lt;/route&gt;
+    &lt;/camelContext&gt;
+
+&lt;/beans&gt;
+]]></script>
+</div></div>
 
 <p>For versions prior to Camel 2.6 you can use an <tt>Activator</tt> to publish the <a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/camel/trunk/components/camel-servlet/src/main/java/org/apache/camel/component/servlet/CamelHttpTransportServlet.java">CamelHttpTransportServlet</a> on the OSGi platform </p>
-<div class="error"><span class="error">Error formatting macro: snippet: java.lang.IndexOutOfBoundsException: Index: 20, Size: 20</span> </div>
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+import java.util.Dictionary;
+import java.util.Hashtable;
+
+import org.apache.camel.component.servlet.CamelHttpTransportServlet;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.http.HttpContext;
+import org.osgi.service.http.HttpService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.osgi.context.BundleContextAware;
+
+public final class ServletActivator implements BundleActivator, BundleContextAware {
+    private static final transient Logger LOG = LoggerFactory.getLogger(ServletActivator.class);
+    private static boolean registerService;
+    
+    /**
+     * HttpService reference.
+     */
+    private ServiceReference httpServiceRef;
+    
+    /**
+     * Called when the OSGi framework starts our bundle
+     */
+    public void start(BundleContext bc) throws Exception {
+        registerServlet(bc);
+    }
+
+    /**
+     * Called when the OSGi framework stops our bundle
+     */
+    public void stop(BundleContext bc) throws Exception {
+        if (httpServiceRef != null) {
+            bc.ungetService(httpServiceRef);
+            httpServiceRef = null;
+        }
+    }
+    
+    protected void registerServlet(BundleContext bundleContext) throws Exception {
+        httpServiceRef = bundleContext.getServiceReference(HttpService.class.getName());
+        
+        if (httpServiceRef != null &amp;&amp; !registerService) {
+            LOG.info("Register the servlet service");
+            final HttpService httpService = (HttpService)bundleContext.getService(httpServiceRef);
+            if (httpService != null) {
+                // create a default context to share between registrations
+                final HttpContext httpContext = httpService.createDefaultHttpContext();
+                // register the hello world servlet
+                final Dictionary&lt;String, String&gt; initParams = new Hashtable&lt;String, String&gt;();
+                initParams.put("matchOnUriPrefix", "false");
+                initParams.put("servlet-name", "CamelServlet");
+                httpService.registerServlet("/camel/services", // alias
+                    new CamelHttpTransportServlet(), // register servlet
+                    initParams, // init params
+                    httpContext // http context
+                );
+                registerService = true;
+            }
+        }
+    }
+
+    public void setBundleContext(BundleContext bc) {
+        try {
+            registerServlet(bc);
+        } catch (Exception e) {
+            LOG.error("Cannot register the servlet, the reason is " + e);
+        }
+    }
+
+}
+]]></script>
+</div></div>
 
 <h3><a shape="rect" name="BookComponentAppendix-SeeAlso"></a>See Also</h3>
 <ul><li><a shape="rect" href="configuring-camel.html" title="Configuring Camel">Configuring Camel</a></li><li><a shape="rect" href="component.html" title="Component">Component</a></li><li><a shape="rect" href="endpoint.html" title="Endpoint">Endpoint</a></li><li><a shape="rect" href="getting-started.html" title="Getting Started">Getting Started</a></li></ul>
@@ -15690,13 +16310,83 @@ spring-integration:defaultChannelName[?o
 <h4><a shape="rect" name="BookComponentAppendix-UsingtheSpringintegrationendpoint"></a>Using the Spring integration endpoint</h4>
 <p>You can set up a Spring integration endpoint using a URI, as follows: </p>
 
-<div class="error"><span class="error">Error formatting macro: snippet: java.lang.IndexOutOfBoundsException: Index: 20, Size: 20</span> </div>
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[
+&lt;beans:beans xmlns="http://www.springframework.org/schema/integration"
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             xmlns:beans="http://www.springframework.org/schema/beans"
+             xsi:schemaLocation="
+             http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+             http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
+             http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd"&gt;
+
+    &lt;!-- spring integration channels --&gt;
+    &lt;channel id="inputChannel"/&gt;
+    &lt;channel id="outputChannel"/&gt;
+    &lt;channel id="onewayChannel"/&gt;
+
+    &lt;!-- spring integration service activators --&gt;
+    &lt;service-activator input-channel="inputChannel" ref="helloService" method="sayHello"/&gt;
+    &lt;service-activator input-channel="onewayChannel" ref="helloService" method="greet"/&gt;
 
-<div class="error"><span class="error">Error formatting macro: snippet: java.lang.IndexOutOfBoundsException: Index: 20, Size: 20</span> </div>
+    &lt;!-- custom bean --&gt;
+    &lt;beans:bean id="helloService" class="org.apache.camel.component.spring.integration.HelloWorldService"/&gt;
+
+    &lt;camelContext id="camel" xmlns="http://camel.apache.org/schema/spring"&gt;
+        &lt;route&gt;
+            &lt;from uri="direct:twowayMessage"/&gt;
+            &lt;to uri="spring-integration:inputChannel?inOut=true&amp;amp;inputChannel=outputChannel"/&gt;
+        &lt;/route&gt;
+        &lt;route&gt;
+            &lt;from uri="direct:onewayMessage"/&gt;
+            &lt;to uri="spring-integration:onewayChannel?inOut=false"/&gt;
+        &lt;/route&gt;
+    &lt;/camelContext&gt;
+]]></script>
+</div></div>
+
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[
+&lt;!-- spring integration channels --&gt;
+&lt;channel id="requestChannel"/&gt;
+&lt;channel id="responseChannel"/&gt;
+
+&lt;!-- cusom Camel processor --&gt;
+&lt;beans:bean id="myProcessor" class="org.apache.camel.component.spring.integration.MyProcessor"/&gt;
+
+&lt;!-- Camel route --&gt;
+&lt;camelContext  xmlns="http://camel.apache.org/schema/spring"&gt;
+    &lt;route&gt;
+        &lt;from uri="spring-integration://requestChannel?outputChannel=responseChannel&amp;amp;inOut=true"/&gt;
+        &lt;process ref="myProcessor"/&gt;
+    &lt;/route&gt;
+&lt;/camelContext&gt;
+]]></script>
+</div></div>
 
 <p>Or directly using a Spring integration channel name:</p>
 
-<div class="error"><span class="error">Error formatting macro: snippet: java.lang.IndexOutOfBoundsException: Index: 20, Size: 20</span> </div>
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[
+&lt;beans:beans xmlns="http://www.springframework.org/schema/integration"
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             xmlns:beans="http://www.springframework.org/schema/beans"
+             xsi:schemaLocation="
+             http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+	         http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
+	         http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd"&gt;
+
+    &lt;!-- spring integration channel --&gt;
+    &lt;channel id="outputChannel"/&gt;
+
+    &lt;camelContext xmlns="http://camel.apache.org/schema/spring"&gt;
+        &lt;route&gt;
+            &lt;from uri="outputChannel"/&gt;
+            &lt;to uri="mock:result"/&gt;
+        &lt;/route&gt;
+    &lt;/camelContext&gt;
+]]></script>
+</div></div>
 
 <h4><a shape="rect" name="BookComponentAppendix-TheSourceandTargetadapter"></a>The Source and Target adapter</h4>
 
@@ -15704,13 +16394,93 @@ spring-integration:defaultChannelName[?o
 
 <p>This example uses the following namespaces:</p>
 
-<div class="error"><span class="error">Error formatting macro: snippet: java.lang.IndexOutOfBoundsException: Index: 20, Size: 20</span> </div>
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[
+&lt;beans:beans xmlns="http://www.springframework.org/schema/integration"
+       xmlns:beans="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:camel-si="http://camel.apache.org/schema/spring/integration"
+       xsi:schemaLocation="
+       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+       http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
+       http://camel.apache.org/schema/spring/integration http://camel.apache.org/schema/spring/integration/camel-spring-integration.xsd
+       http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
+    "&gt;
+]]></script>
+</div></div>
 
 <p>You can bind your source or target to a Camel endpoint as follows:</p>
 
-<div class="error"><span class="error">Error formatting macro: snippet: java.lang.IndexOutOfBoundsException: Index: 20, Size: 20</span> </div>
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[
+&lt;!-- Create the camel context here --&gt;
+&lt;camelContext id="camelTargetContext" xmlns="http://camel.apache.org/schema/spring"&gt;
+    &lt;route&gt;
+        &lt;from uri="direct:EndpointA" /&gt;
+        &lt;to uri="mock:result" /&gt;
+    &lt;/route&gt;
+    &lt;route&gt;
+        &lt;from uri="direct:EndpointC"/&gt;
+        &lt;process ref="myProcessor"/&gt;
+      &lt;/route&gt;
+&lt;/camelContext&gt;
+
+&lt;!-- We can bind the camelTarget to the camel context's endpoint by specifying the camelEndpointUri attribute --&gt;
+&lt;camel-si:camelTarget id="camelTargetA" camelEndpointUri="direct:EndpointA" expectReply="false"&gt;
+    &lt;camel-si:camelContextRef&gt;camelTargetContext&lt;/camel-si:camelContextRef&gt;
+&lt;/camel-si:camelTarget&gt;
+
+&lt;camel-si:camelTarget id="camelTargetB" camelEndpointUri="direct:EndpointC" replyChannel="channelC" expectReply="true"&gt;
+    &lt;camel-si:camelContextRef&gt;camelTargetContext&lt;/camel-si:camelContextRef&gt;
+&lt;/camel-si:camelTarget&gt;
+
+&lt;camel-si:camelTarget id="camelTargetD" camelEndpointUri="direct:EndpointC" expectReply="true"&gt;
+    &lt;camel-si:camelContextRef&gt;camelTargetContext&lt;/camel-si:camelContextRef&gt;
+&lt;/camel-si:camelTarget&gt;
+
+&lt;beans:bean id="myProcessor" class="org.apache.camel.component.spring.integration.MyProcessor"/&gt;
+]]></script>
+</div></div>
+
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[
+&lt;!-- spring integration channels --&gt;
+&lt;channel id="channelA"/&gt;
+&lt;channel id="channelB"/&gt;
+&lt;channel id="channelC"/&gt;
 
-<div class="error"><span class="error">Error formatting macro: snippet: java.lang.IndexOutOfBoundsException: Index: 20, Size: 20</span> </div>
+&lt;!-- spring integration service activator --&gt;
+&lt;service-activator input-channel="channelB" output-channel="channelC" ref="helloService" method="sayHello"/&gt;
+
+&lt;!-- custom bean --&gt;
+&lt;beans:bean id="helloService" class="org.apache.camel.component.spring.integration.HelloWorldService"/&gt;
+
+&lt;camelContext id="camelSourceContext" xmlns="http://camel.apache.org/schema/spring"&gt;
+    &lt;route&gt;
+        &lt;from uri="direct:OneWay"/&gt;
+        &lt;to uri="direct:EndpointB"/&gt;
+    &lt;/route&gt;
+    &lt;route&gt;
+        &lt;from uri="direct:TwoWay"/&gt;
+        &lt;to uri="direct:EndpointC"/&gt;
+    &lt;/route&gt;
+&lt;/camelContext&gt;
+
+&lt;!-- camelSource will redirect the message coming for direct:EndpointB to the spring requestChannel channelA --&gt;
+&lt;camel-si:camelSource id="camelSourceA" camelEndpointUri="direct:EndpointB"
+                      requestChannel="channelA" expectReply="false"&gt;
+    &lt;camel-si:camelContextRef&gt;camelSourceContext&lt;/camel-si:camelContextRef&gt;
+&lt;/camel-si:camelSource&gt;
+
+&lt;!-- camelSource will redirect the message coming for direct:EndpointC to the spring requestChannel channelB
+     then it will pull the response from channelC and put the response message back to direct:EndpointC --&gt;
+
+&lt;camel-si:camelSource id="camelSourceB" camelEndpointUri="direct:EndpointC"
+                      requestChannel="channelB" replyChannel="channelC" expectReply="true"&gt;
+    &lt;camel-si:camelContextRef&gt;camelSourceContext&lt;/camel-si:camelContextRef&gt;
+&lt;/camel-si:camelSource&gt;
+]]></script>
+</div></div>
 
 
 <h3><a shape="rect" name="BookComponentAppendix-SeeAlso"></a>See Also</h3>
@@ -16235,7 +17005,42 @@ template.sendBody("direct:in", "Hello By
 
 <p>The following sample demonstrates how the header type can be used to determine which stream to use. In the sample we use our own output stream, <tt>MyOutputStream</tt>.</p>
 
-<div class="error"><span class="error">Error formatting macro: snippet: java.lang.IndexOutOfBoundsException: Index: 20, Size: 20</span> </div>
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+private OutputStream mystream = new MyOutputStream();
+private StringBuilder sb = new StringBuilder();
+
+@Test
+public void testStringContent() {
+    template.sendBody("direct:in", "Hello");
+    // StreamProducer appends \n in text mode
+    assertEquals("Hello\n", sb.toString());
+}
+
+@Test
+public void testBinaryContent() {
+    template.sendBody("direct:in", "Hello".getBytes());
+    // StreamProducer is in binary mode so no \n is appended
+    assertEquals("Hello", sb.toString());
+}
+
+protected RouteBuilder createRouteBuilder() {
+    return new RouteBuilder() {
+        public void configure() {
+            from("direct:in").setHeader("stream", constant(mystream)).
+                to("stream:header");
+        }
+    };
+}
+
+private class MyOutputStream extends OutputStream {
+
+    public void write(int b) throws IOException {
+        sb.append((char)b);
+    }
+}
+]]></script>
+</div></div>
 
 <p>The following sample demonstrates how to continuously read a file stream (analogous to the UNIX <tt>tail</tt> command):</p>
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
@@ -16323,7 +17128,38 @@ Regards Camel Riders Bookstore
 
 <p>And the java code is as follows:</p>
 
-<div class="error"><span class="error">Error formatting macro: snippet: java.lang.IndexOutOfBoundsException: Index: 20, Size: 20</span> </div>
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+private Exchange createLetter() {
+    Exchange exchange = context.getEndpoint("direct:a").createExchange();
+    Message msg = exchange.getIn();
+    msg.setHeader("firstName", "Claus");
+    msg.setHeader("lastName", "Ibsen");
+    msg.setHeader("item", "Camel in Action");
+    msg.setBody("PS: Next beer is on me, James");
+    return exchange;
+}
+
+@Test
+public void testVelocityLetter() throws Exception {
+    MockEndpoint mock = getMockEndpoint("mock:result");
+    mock.expectedMessageCount(1);
+    mock.expectedBodiesReceived("Dear Ibsen, Claus! Thanks for the order of Camel in Action. Regards Camel Riders Bookstore PS: Next beer is on me, James");
+
+    template.send("direct:a", createLetter());
+
+    mock.assertIsSatisfied();
+}
+
+protected RouteBuilder createRouteBuilder() throws Exception {
+    return new RouteBuilder() {
+        public void configure() throws Exception {
+            from("direct:a").to("string-template:org/apache/camel/component/stringtemplate/letter.tm").to("mock:result");
+        }
+    };
+}
+]]></script>
+</div></div>
 
 <h3><a shape="rect" name="BookComponentAppendix-SeeAlso"></a>See Also</h3>
 <ul><li><a shape="rect" href="configuring-camel.html" title="Configuring Camel">Configuring Camel</a></li><li><a shape="rect" href="component.html" title="Component">Component</a></li><li><a shape="rect" href="endpoint.html" title="Endpoint">Endpoint</a></li><li><a shape="rect" href="getting-started.html" title="Getting Started">Getting Started</a></li></ul>
@@ -16968,7 +17804,24 @@ validator:someLocalOrRemoteResource
 
 <p>The following <a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/validator/camelContext.xml">example</a> shows how to configure a route from endpoint <b>direct:start</b> which then goes to one of two endpoints, either <b>mock:valid</b> or <b>mock:invalid</b> based on whether or not the XML matches the given schema (which is supplied on the classpath).</p>
 
-<div class="error"><span class="error">Error formatting macro: snippet: java.lang.IndexOutOfBoundsException: Index: 20, Size: 20</span> </div>
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[
+&lt;route&gt;
+    &lt;from uri="direct:start"/&gt;
+    &lt;doTry&gt;
+        &lt;to uri="validator:org/apache/camel/component/validator/schema.xsd"/&gt;
+        &lt;to uri="mock:valid"/&gt;
+        &lt;doCatch&gt;
+            &lt;exception&gt;org.apache.camel.ValidationException&lt;/exception&gt;
+            &lt;to uri="mock:invalid"/&gt;
+        &lt;/doCatch&gt;
+        &lt;doFinally&gt;
+            &lt;to uri="mock:finally"/&gt;
+        &lt;/doFinally&gt;
+    &lt;/doTry&gt;
+&lt;/route&gt;
+]]></script>
+</div></div>
 
 <h3><a shape="rect" name="BookComponentAppendix-SeeAlso"></a>See Also</h3>
 <ul><li><a shape="rect" href="configuring-camel.html" title="Configuring Camel">Configuring Camel</a></li><li><a shape="rect" href="component.html" title="Component">Component</a></li><li><a shape="rect" href="endpoint.html" title="Endpoint">Endpoint</a></li><li><a shape="rect" href="getting-started.html" title="Getting Started">Getting Started</a></li></ul>
@@ -17121,7 +17974,38 @@ ${body}
 
 <p>And the java code:</p>
 
-<div class="error"><span class="error">Error formatting macro: snippet: java.lang.IndexOutOfBoundsException: Index: 20, Size: 20</span> </div>
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+private Exchange createLetter() {
+    Exchange exchange = context.getEndpoint("direct:a").createExchange();
+    Message msg = exchange.getIn();
+    msg.setHeader("firstName", "Claus");
+    msg.setHeader("lastName", "Ibsen");
+    msg.setHeader("item", "Camel in Action");
+    msg.setBody("PS: Next beer is on me, James");
+    return exchange;
+}
+
+@Test
+public void testVelocityLetter() throws Exception {
+    MockEndpoint mock = getMockEndpoint("mock:result");
+    mock.expectedMessageCount(1);
+    mock.expectedBodiesReceived("Dear Ibsen, Claus\n\nThanks for the order of Camel in Action.\n\nRegards Camel Riders Bookstore\nPS: Next beer is on me, James");
+
+    template.send("direct:a", createLetter());
+
+    mock.assertIsSatisfied();
+}
+
+protected RouteBuilder createRouteBuilder() throws Exception {
+    return new RouteBuilder() {
+        public void configure() throws Exception {
+            from("direct:a").to("velocity:org/apache/camel/component/velocity/letter.vm").to("mock:result");
+        }
+    };
+}
+]]></script>
+</div></div>
 
 <h3><a shape="rect" name="BookComponentAppendix-SeeAlso"></a>See Also</h3>
 <ul><li><a shape="rect" href="configuring-camel.html" title="Configuring Camel">Configuring Camel</a></li><li><a shape="rect" href="component.html" title="Component">Component</a></li><li><a shape="rect" href="endpoint.html" title="Endpoint">Endpoint</a></li><li><a shape="rect" href="getting-started.html" title="Getting Started">Getting Started</a></li></ul>
@@ -17279,7 +18163,14 @@ to("activemq:krypton.talk");
 </div></div>
 
 <p>When connecting to the Google Chat service, you'll need to specify the <tt>serviceName</tt> as well as your credentials:</p>
-<div class="error"><span class="error">Error formatting macro: snippet: java.lang.IndexOutOfBoundsException: Index: 20, Size: 20</span> </div>
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+// send a message from fromuser@gmail.com to touser@gmail.com
+from("direct:start").
+        to("xmpp://talk.google.com:5222/touser@gmail.com?serviceName=gmail.com&amp;user=fromuser&amp;password=secret").
+        to("mock:result");
+]]></script>
+</div></div>
 <h3><a shape="rect" name="BookComponentAppendix-SeeAlso"></a>See Also</h3>
 <ul><li><a shape="rect" href="configuring-camel.html" title="Configuring Camel">Configuring Camel</a></li><li><a shape="rect" href="component.html" title="Component">Component</a></li><li><a shape="rect" href="endpoint.html" title="Endpoint">Endpoint</a></li><li><a shape="rect" href="getting-started.html" title="Getting Started">Getting Started</a></li></ul>