title: RESTLET on Camel with Jetty
body: <p>As far as I understand, Camel by default uses the default RESTLET engine. How can I tell Camel to use Jetty instead?</p>
  
  <p>I know there are ways to bundle your application and deploy it in Tomcat or Jetty. If I do that, however, the biggest question becomes how to integrate with RESTLET.</p>
  
  <p>I did some further digging. I took one of the tomcat examples that come with the camel. Then I tried to make it RESTLET capable. It almost works. The problem now is that the parameters are not being passed to the route. I would expect that when calling this server: <a href="http://x.x.x.x:8080/rs/user/?name=Paul" rel="nofollow">http://x.x.x.x:8080/rs/user/?name=Paul</a>, I would get: Hello Paul how are you?</p>
  
  <p>However, I simply get: Hello  how are you?</p>
  
  <p>My camel configuration is:</p>
  
  <pre><code>    &lt;camelContext xmlns="http://camel.apache.org/schema/spring"&gt;
      &lt;route&gt;
          &lt;from uri="restlet:/user/?restletMethods=GET,POST" /&gt;
          &lt;transform&gt;
              &lt;simple&gt;Hello ${header.name} how are you?&lt;/simple&gt;
          &lt;/transform&gt;
      &lt;/route&gt;
  &lt;/camelContext&gt;
  &lt;bean id="RestletComponent" class="org.restlet.Component" /&gt;
  &lt;bean id="RestletComponentService" class="org.apache.camel.component.restlet.RestletComponent"&gt;
      &lt;constructor-arg index="0"&gt;
          &lt;ref bean="RestletComponent" /&gt;
      &lt;/constructor-arg&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>And my web.xml is:</p>
  
  <pre><code>&lt;context-param&gt;
      &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
      &lt;param-value&gt;classpath:camel-config.xml&lt;/param-value&gt;
  &lt;/context-param&gt;
  
  &lt;servlet&gt;
      &lt;servlet-name&gt;RestletServlet&lt;/servlet-name&gt;
      &lt;servlet-class&gt;org.restlet.ext.spring.SpringServerServlet&lt;/servlet-class&gt;
      &lt;init-param&gt;
          &lt;param-name&gt;org.restlet.component&lt;/param-name&gt;
          &lt;param-value&gt;RestletComponent&lt;/param-value&gt;
      &lt;/init-param&gt;
  &lt;/servlet&gt;
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;RestletServlet&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/rs/*&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  </code></pre>
  
  <p>I am getting a little bit closer with my investigation. It appears that ${in.body} will indeed pass the body of the request to the route. I am still trying to find out what is going on with the header. I even tried using the producer template to call the headers, still it does work. So, this somehow suggests that the way to access the header in RESTLET is different than in the pure servlet? Here is my producer template:</p>
  
  <pre><code> Map&lt;String, Object&gt; headers = new HashMap&lt;String, Object&gt;();
     headers.put("name","Paul");
  
      context.createProducerTemplate().requestBodyAndHeaders(
              "restlet:http://localhost:8080/camel-example-servlet-tomcat/rs/user/?restletMethod=post", "Halleluia",headers);
  </code></pre>