camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gavagai <>
Subject Re: Adding HTTP Headers to All Jetty Routes
Date Tue, 05 Aug 2014 14:53:55 GMT
Thanks Claus - 

I think this has gotten me on the right track, but I'm not quite there yet
and am not sure why. Here are some snippets of code to help describe the
problem. We are using the Groovy DSL and executing using "Main."

Here is the new binding definition:

    class CORSHttpBinding extends DefaultHttpBinding {
        public void writeResponse(exch, resp) {
            resp.Header("test", "test")
            super.writeResponse(exch, resp)

This is added to the Registry via "Main" as follows:

    Main main = new Main()
    main.bind("CORSHttpBinding", new CORSHttpBinding())

Finally, the Jetty route is specified as follows (additional routing after
this has been omitted):


I've added some debugging code in various places, but "writeResponse()" is
never called.

Thanks for any help - I am fairly new to this, if that's not obvious, and am
still getting my Camel-legs.


View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message