I want to use the Jetty component in a Camel environment. This is an excerpt of my spring-config.xml:
...
<bean id="webEnc" class="web.WebEnc" />
<camelContext>
<route>
<from uri="jetty:http://0.0.0.0/enc" />
<process ref="webEnc" />
</route>
</camelContext>
...
And here is the code used to return a String:
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
public class WebEnc implements Processor{
@Override
public void process(Exchange exchange) throws Exception {
exchange.getOut().setBody("abcäöüß\"€一二三"); //the last three symbols are chinese for '123'
}
}
The local address works (http://127.0.0.1/enc) but the browser does not display the string correctly (displayed as 'abcäöüß"€一二三'). I assume the problem is some encoding. How to set the encoding like 'utf-8'?
I can't find any hint here (http://camel.apache.org/jetty.html) concerning encoding or charset or something like that.