You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Naveen Subramanian <wi...@gmail.com> on 2015/03/18 11:50:22 UTC
Camel - CDI and Servlet Context Implementation
Hi,
I have implemented Camel with Servlet implementation using ServletContext.
I wish to implement CDI as well (which needs CdiCamelConext).
I am unable to find a way to implement both. Please suggest.
My web.xml
<context-param>
<param-name>routeBuilder-routes</param-name>
<param-value>packagescan:com.example.api.routes</param-value>
</context-param>
<context-param>
<param-name>CamelContextLifecycle</param-name>
<param-value>com.example.api.camel.CustomCamelContextLifeCycle</param-value>
</context-param>
<listener>
<listener-class>org.apache.camel.component.servletlistener.SimpleCamelServletContextListener</listener-class>
</listener>
<!-- Servlet mapping -->
<servlet>
<display-name>APIServerServlet</display-name>
<servlet-name>CamelServlet</servlet-name>
<servlet-class>org.apache.camel.component.servlet.CamelHttpTransportServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>CamelServlet</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
(P.S no Spring )