...
The Require-Capability instruction is very important in order for CDI initialization, discovery and injections to work with Apache CXF. The Web-ContextPath is the context path for this web application to be deployed at. And _wab is the instruction to point out the web.xml file location. Please notice, the application will not be deployed under usual /cxf endpoint (common endpoint for regular Apache CXF services). The reason for that is that Pax Web is used for deployment of web CDI applications.
Web Application Configuration
At the moment, Apache CXF OSGi application should explicitly provide web.xml descriptor with at least CXFCdiServlet defined. For example:
Code Block | ||||
---|---|---|---|---|
| ||||
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<servlet>
<servlet-name>CXFServlet</servlet-name>
<display-name>CXF Servlet</display-name>
<servlet-class>org.apache.cxf.cdi.CXFCdiServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>CXFServlet</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
</web-app> |