You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2022/10/07 08:38:37 UTC

[myfaces-tobago] branch main updated: feat: xml namespace (#3331)

This is an automated email from the ASF dual-hosted git repository.

lofwyr pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git


The following commit(s) were added to refs/heads/main by this push:
     new 3996a0fea8 feat: xml namespace (#3331)
3996a0fea8 is described below

commit 3996a0fea84e5b2db092dcd9e08538ea0371af9f
Author: Udo Schnurpfeil <gi...@schnurpfeil.de>
AuthorDate: Fri Oct 7 10:38:32 2022 +0200

    feat: xml namespace (#3331)
    
    Rename the namespaces for web.xml and web-fragment.xml to
    current spec.
    
    Issue: TOBAGO-2094
---
 README.md                                                   | 13 +++++++++++++
 tobago-core/src/main/faces-config/faces-config.xml          |  6 +++---
 tobago-core/src/main/resources/META-INF/web-fragment.xml    |  6 +++---
 .../src/main/webapp/WEB-INF/faces-config.xml                |  6 +++---
 .../tobago-example-blank/src/main/webapp/WEB-INF/web.xml    |  6 +++---
 .../src/main/webapp/WEB-INF/faces-config.xml                |  6 +++---
 .../tobago-example-demo/src/main/webapp/WEB-INF/web.xml     |  6 +++---
 .../src/main/resources/META-INF/web-fragment.xml            |  6 +++---
 .../src/main/resources/META-INF/web-fragment.xml            |  6 +++---
 .../src/main/resources/META-INF/web-fragment.xml            |  6 +++---
 .../src/main/resources/META-INF/web-fragment.xml            |  6 +++---
 .../myfaces/tobago/apt/processor/FacesConfigGenerator.java  |  6 +++---
 12 files changed, 46 insertions(+), 33 deletions(-)

diff --git a/README.md b/README.md
index 8fcd441cb9..b3db527042 100644
--- a/README.md
+++ b/README.md
@@ -18,6 +18,19 @@ mvn clean install
 to run the install target on all sub projects. This will
 put all necessary artifacts into your local repository.
 
+## Demo - TomEE
+### ⚠ some problems ⚠
+* AJAX is not working
+
+Switch to sub-directory and call Maven to run the demo:
+
+```
+cd tobago-example/tobago-example-demo
+mvn clean package tomee:run -Ptomee -Pdev
+```
+
+Browse to the local URL http://localhost:8080/
+
 ## Demo - Jetty - MyFaces - OWB
 ### ⚠ currently broken ⚠
 * Problem with CDI
diff --git a/tobago-core/src/main/faces-config/faces-config.xml b/tobago-core/src/main/faces-config/faces-config.xml
index c017ed151f..37407ffb54 100644
--- a/tobago-core/src/main/faces-config/faces-config.xml
+++ b/tobago-core/src/main/faces-config/faces-config.xml
@@ -18,10 +18,10 @@
 -->
 
 <faces-config
-    xmlns="http://xmlns.jcp.org/xml/ns/javaee"
+    xmlns="https://jakarta.ee/xml/ns/jakartaee"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_3.xsd"
-    version="2.3">
+    xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-facesconfig_3_0.xsd"
+    version="3.0">
 
   <name>tobago_core</name>
 
diff --git a/tobago-core/src/main/resources/META-INF/web-fragment.xml b/tobago-core/src/main/resources/META-INF/web-fragment.xml
index 0543a4d643..6a97bbd296 100644
--- a/tobago-core/src/main/resources/META-INF/web-fragment.xml
+++ b/tobago-core/src/main/resources/META-INF/web-fragment.xml
@@ -18,10 +18,10 @@
 -->
 
 <web-fragment
-    xmlns="http://xmlns.jcp.org/xml/ns/javaee"
+    xmlns="https://jakarta.ee/xml/ns/jakartaee"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-fragment_3_1.xsd"
-    version="3.1">
+    xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-fragment_5_0.xsd"
+    version="5.0">
 
   <name>tobago_core</name>
   <description>MyFaces Tobago Core</description>
diff --git a/tobago-example/tobago-example-blank/src/main/webapp/WEB-INF/faces-config.xml b/tobago-example/tobago-example-blank/src/main/webapp/WEB-INF/faces-config.xml
index c0c4293d8e..74a4496803 100644
--- a/tobago-example/tobago-example-blank/src/main/webapp/WEB-INF/faces-config.xml
+++ b/tobago-example/tobago-example-blank/src/main/webapp/WEB-INF/faces-config.xml
@@ -18,10 +18,10 @@
 -->
 
 <faces-config
-    xmlns="http://xmlns.jcp.org/xml/ns/javaee"
+    xmlns="https://jakarta.ee/xml/ns/jakartaee"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_3.xsd"
-    version="2.3">
+    xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-facesconfig_3_0.xsd"
+    version="3.0">
 
   <application>
     <locale-config>
diff --git a/tobago-example/tobago-example-blank/src/main/webapp/WEB-INF/web.xml b/tobago-example/tobago-example-blank/src/main/webapp/WEB-INF/web.xml
index d1ebb8b200..0a7b25be38 100644
--- a/tobago-example/tobago-example-blank/src/main/webapp/WEB-INF/web.xml
+++ b/tobago-example/tobago-example-blank/src/main/webapp/WEB-INF/web.xml
@@ -17,10 +17,10 @@
  * limitations under the License.
 -->
 
-<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
+<web-app xmlns="https://jakarta.ee/xml/ns/jakartaee"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
-         version="4.0">
+         xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_5_0.xsd"
+         version="5.0">
 
   <display-name>Blank Tobago Application</display-name>
 
diff --git a/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/faces-config.xml b/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/faces-config.xml
index 9fc9e06526..ca642c9101 100644
--- a/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/faces-config.xml
+++ b/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/faces-config.xml
@@ -18,10 +18,10 @@
 -->
 
 <faces-config
-    xmlns="http://xmlns.jcp.org/xml/ns/javaee"
+    xmlns="https://jakarta.ee/xml/ns/jakartaee"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_3.xsd"
-    version="2.3">
+    xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-facesconfig_3_0.xsd"
+    version="3.0">
   <application>
     <locale-config>
       <default-locale>en</default-locale>
diff --git a/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/web.xml b/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/web.xml
index c6072f1727..b4351fefd4 100644
--- a/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/web.xml
+++ b/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/web.xml
@@ -17,10 +17,10 @@
  * limitations under the License.
 -->
 
-<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
+<web-app xmlns="https://jakarta.ee/xml/ns/jakartaee"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
-         version="4.0">
+         xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_5_0.xsd"
+         version="5.0">
 
   <display-name>Tobago Demo Application</display-name>
 
diff --git a/tobago-tool/tobago-config-dev/src/main/resources/META-INF/web-fragment.xml b/tobago-tool/tobago-config-dev/src/main/resources/META-INF/web-fragment.xml
index 083c32201c..82cdfba327 100644
--- a/tobago-tool/tobago-config-dev/src/main/resources/META-INF/web-fragment.xml
+++ b/tobago-tool/tobago-config-dev/src/main/resources/META-INF/web-fragment.xml
@@ -18,10 +18,10 @@
 -->
 
 <web-fragment
-    xmlns="http://xmlns.jcp.org/xml/ns/javaee"
+    xmlns="https://jakarta.ee/xml/ns/jakartaee"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-fragment_3_1.xsd"
-    version="3.1">
+    xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-fragment_5_0.xsd"
+    version="5.0">
 
   <name>tobago_config_dev</name>
 
diff --git a/tobago-tool/tobago-config-mojarra/src/main/resources/META-INF/web-fragment.xml b/tobago-tool/tobago-config-mojarra/src/main/resources/META-INF/web-fragment.xml
index 8faecec988..6e7d76a185 100644
--- a/tobago-tool/tobago-config-mojarra/src/main/resources/META-INF/web-fragment.xml
+++ b/tobago-tool/tobago-config-mojarra/src/main/resources/META-INF/web-fragment.xml
@@ -18,10 +18,10 @@
 -->
 
 <web-fragment
-    xmlns="http://xmlns.jcp.org/xml/ns/javaee"
+    xmlns="https://jakarta.ee/xml/ns/jakartaee"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-fragment_3_1.xsd"
-    version="3.1">
+    xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-fragment_5_0.xsd"
+    version="5.0">
 
   <name>tobago_config_mojarra</name>
 
diff --git a/tobago-tool/tobago-config-myfaces/src/main/resources/META-INF/web-fragment.xml b/tobago-tool/tobago-config-myfaces/src/main/resources/META-INF/web-fragment.xml
index 9b72fdf51a..e42813c02b 100644
--- a/tobago-tool/tobago-config-myfaces/src/main/resources/META-INF/web-fragment.xml
+++ b/tobago-tool/tobago-config-myfaces/src/main/resources/META-INF/web-fragment.xml
@@ -18,10 +18,10 @@
 -->
 
 <web-fragment
-    xmlns="http://xmlns.jcp.org/xml/ns/javaee"
+    xmlns="https://jakarta.ee/xml/ns/jakartaee"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-fragment_3_1.xsd"
-    version="3.1">
+    xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-fragment_5_0.xsd"
+    version="5.0">
 
   <name>tobago_config_myfaces</name>
 
diff --git a/tobago-tool/tobago-config-owb/src/main/resources/META-INF/web-fragment.xml b/tobago-tool/tobago-config-owb/src/main/resources/META-INF/web-fragment.xml
index c3f4dc923b..ad5c53274c 100644
--- a/tobago-tool/tobago-config-owb/src/main/resources/META-INF/web-fragment.xml
+++ b/tobago-tool/tobago-config-owb/src/main/resources/META-INF/web-fragment.xml
@@ -18,10 +18,10 @@
 -->
 
 <web-fragment
-    xmlns="http://xmlns.jcp.org/xml/ns/javaee"
+    xmlns="https://jakarta.ee/xml/ns/jakartaee"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-fragment_3_1.xsd"
-    version="3.1">
+    xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-fragment_5_0.xsd"
+    version="5.0">
 
   <name>tobago_config_owb</name>
 
diff --git a/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/processor/FacesConfigGenerator.java b/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/processor/FacesConfigGenerator.java
index 78cd92e7ee..11ee5f49d2 100644
--- a/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/processor/FacesConfigGenerator.java
+++ b/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/processor/FacesConfigGenerator.java
@@ -164,12 +164,12 @@ public class FacesConfigGenerator extends AbstractGenerator {
 
     final org.jdom2.Element rootElement = document.getRootElement();
 
-    rootElement.setNamespace(Namespace.getNamespace("http://xmlns.jcp.org/xml/ns/javaee"));
+    rootElement.setNamespace(Namespace.getNamespace("https://jakarta.ee/xml/ns/jakartaee"));
     final Namespace xsi = Namespace.getNamespace("xsi", "http://www.w3.org/2001/XMLSchema-instance");
 //    rootElement.addNamespaceDeclaration(Namespace.getNamespace("xi", "http://www.w3.org/2001/XInclude"));
     rootElement.setAttribute(new Attribute("schemaLocation",
-        "http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_3.xsd", xsi));
-    rootElement.setAttribute("version", "2.3");
+        "https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-facesconfig_3_0.xsd", xsi));
+    rootElement.setAttribute("version", "3.0");
 
     final Namespace namespace = rootElement.getNamespace();
     applyNamespace(rootElement, namespace);