camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Block <andy.bl...@gmail.com>
Subject Re: Configuring a servlet with camel-jetty
Date Wed, 29 Oct 2014 15:36:52 GMT
Jack,

Have you added the handler to the Camel Registry with the name MyContextHandler? In your example,
you are referencing the “MyContetHandler” in your route, but never show it being added
to the Camel registry.

- Andy

-- 
Andrew Block


On October 29, 2014 at 10:14:21 AM, jack atwork (jrmpatwork@gmail.com) wrote:

apologies, hit send by a bit early!  

Hi,  

I'm trying to configure a servlet using the camel-jetty component but I'm  
struggling and hoping somebody might be able to point out what I'm doing  
wrong.  

I expected to be able to register a new Handler and reference it in the  
endpoint uri.  

ServletContextHandler handler = new ServletContextHandler();  
handler.addServlet(new ServletHolder(myServlet), "/*");  

Then adding a route to my routeBuilder:  

from("jetty:  
http://localhost:8080/?matchOnUriPrefix=true&handlers=#MyContextHandler")  
.to("log:foo");  

I can see my servlet gets initialised but it is never invoked on any  
requests. Can anyone tell me what's missing?  

Thanks,  

Jack  


On 29 October 2014 15:06, jack atwork <jrmpatwork@gmail.com> wrote:  

> Hi,  
>  
> I'm trying to configure a servlet using the camel-jetty component but I'm  
> struggling and hoping somebody might be able to point out what I'm doing  
> wrong.  
>  
> I expected to be able to register a new Handler and reference it in the  
> endpoint uri .  
>  
> ServletContextHandler handler = new ServletContextHandler();  
> handler.addServlet(new ServletHolder(myServlet), "/*");  
>  
> Then adding a route to my routeBuilder:  
>  
>  
>  
>  
>  

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message