ttomcat-1778514358873.zip-extract/apache-tomcat-11.0.18-src/webapps/docs/cdi.xml

Path
ttomcat-1778514358873.zip-extract/apache-tomcat-11.0.18-src/webapps/docs/cdi.xml
Status
scanned
Type
file
Name
cdi.xml
Extension
.xml
Programming language

      
    
Mime type
text/xml
File type
XML 1.0 document, ASCII text, with CRLF line terminators
Tag

      
    
Rootfs path

      
    
Size
4559 (4.5 KB)
MD5
dd8787b7797322141d66bc3d72f9641b
SHA1
2acc0223383a931389c34063d6045c4f23b48814
SHA256
308ed608069851cf7f2dce0731867e6cbba18bc0f66a89667fd9519eedd622d7
SHA512

      
    
SHA1_git
92af94d0d227aeea6b7ae8123786b1e9342ecdab
Is binary

      
    
Is text
True
Is archive

      
    
Is media

      
    
Is legal

      
    
Is manifest

      
    
Is readme

      
    
Is top level

      
    
Is key file

      
    
cdi.xml | 4.5 KB |

<?xml version="1.0" encoding="UTF-8"?> <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <!DOCTYPE document [ <!ENTITY project SYSTEM "project.xml"> ]> <document url="cdi.html"> &project; <properties> <title>CDI, JAX-RS and dependent libraries support</title> </properties> <body> <section name="Table of Contents"> <toc/> </section> <section name="Introduction"> <p> CDI and JAX-RS are dependencies for many other APIs and libraries. This guide explains how to add support for them in Tomcat using two optional modules that are provided in the Tomcat sources. </p> </section> <section name="CDI support"> <p> CDI support is provided by the <code>modules/owb</code> optional module. It packages the Apache OpenWebBeans project and allows adding CDI support to the Tomcat container. The build process of the module uses Apache Maven, and is not available as a binary bundle as it is built using a number of publicly available JARs. </p> <p> The process to build CDI support is the following. <source><![CDATA[cd $TOMCAT_SRC/modules/owb mvn clean && mvn package]]></source> The resulting JAR at <code>target/tomcat-owb-x.y.z.jar</code> (where x.y.z depends on the Apache OpenWebBeans version used during the build) should be processed by the Tomcat migration tool for Jakarta EE, and then be placed into the <code>lib</code> folder of the Tomcat installation.<br/> CDI support can then be enabled for all webapps in the container by adding the following listener in <code>server.xml</code> nested inside the <code>Server</code> element: <source><![CDATA[<Listener className="org.apache.webbeans.web.tomcat.OpenWebBeansListener" optional="true" startWithoutBeansXml="false" />]]></source> The listener will produce a non fatal error if the CDI container loading fails.<br/> CDI support can also be enabled at the individual webapp level by adding the following listener to the webapp <code>context.xml</code> file nested inside the <code>Server</code> element: <source><![CDATA[<Listener className="org.apache.webbeans.web.tomcat.OpenWebBeansContextLifecycleListener" />]]></source> </p> </section> <section name="JAX-RS support"> <p> JAX-RS support is provided by the <code>modules/cxf</code> optional module. It packages the Apache CXF project and allows adding JAX-RS support to individual webapps. The build process of the module uses Apache Maven, and is not available as a binary bundle as it is built using a number of publicly available JARs. The support depends on CDI support, which should have previously been installed at either the container or webapp level. </p> <p> The process to build JAX-RS support is the following. <source><![CDATA[cd $TOMCAT_SRC/modules/cxf mvn clean && mvn package]]></source> The resulting JAR at <code>target/tomcat-cxf-x.y.z.jar</code> (where x.y.z depends on the Apache CXF version used during the build) should then be placed into the <code>/WEB-INF/lib</code> folder of the desired web application. </p> <p> If the CDI support is available at the container level, the JAR can also be placed in the Tomcat <code>lib</code> folder, but in that case the CXF Servlet declaration must be individually added in each webapp as needed (it is normally loaded by the web fragment that is present in the JAR). The CXF Servlet class that should be used is <code>org.apache.cxf.cdi.CXFCdiServlet</code> and should be mapped to the desired root path where JAX-RS resources will be available. </p> </section> </body> </document>
Detected license expression
apache-2.0
Detected license expression (SPDX)
Apache-2.0
Percentage of license text
18.22
Copyrights

      
    
Holders

      
    
Authors

      
    
License detections License expression License expression SPDX
apache_2_0-4bde3f57-78aa-4201-96bf-531cba09e7de apache-2.0 Apache-2.0
URL Start line End line
http://www.apache.org/licenses/LICENSE-2.0 10 10