You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在WildFly Swarm/Thorntail中启用JSF 2.3?或何时适配WildFly 12?

Enabling JSF 2.3 in WildFly Swarm/Thorntail & Version Timeline

Great question! Let's split this into two clear parts: getting JSF 2.3 running in your current 2018.5.0 setup, and when you can expect it to come out of the box.

Using JSF 2.3 with WildFly Swarm/Thorntail 2018.5.0

Since this version is based on WildFly 11 (Java EE 7) which ships with JSF 2.2.13, you'll need to replace the native JSF module with a 2.3 implementation. Here's how:

  1. Exclude the default JSF module
    In your pom.xml, exclude the built-in JSF dependencies from the Swarm JSF fraction to avoid version conflicts:

    <dependency>
        <groupId>org.wildfly.swarm</groupId>
        <artifactId>jsf</artifactId>
        <exclusions>
            <exclusion>
                <groupId>org.jboss.spec.javax.faces</groupId>
                <artifactId>jboss-jsf-api_2.2_spec</artifactId>
            </exclusion>
            <exclusion>
                <groupId>org.jboss.as</groupId>
                <artifactId>jboss-as-jsf</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    
  2. Add JSF 2.3 implementation
    Include a compatible JSF 2.3 library (like Mojarra 2.3.x) directly in your project. Most 2.3.x releases work smoothly with Java EE 7 environments:

    <dependency>
        <groupId>org.glassfish</groupId>
        <artifactId>javax.faces</artifactId>
        <version>2.3.14</version>
    </dependency>
    
  3. Configure deployment to use JSF 2.3
    Update or create a WEB-INF/faces-config.xml file to explicitly declare the JSF 2.3 version:

    <?xml version="1.0" encoding="UTF-8"?>
    <faces-config xmlns="http://xmlns.jcp.org/xml/ns/javaee"
                 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">
        <!-- Your existing configuration rules here -->
    </faces-config>
    

    You can also enforce the version via a system property in your project-defaults.yml Swarm config:

    swarm:
        system-properties:
            javax.faces.VERSION: 2.3
    

When will WildFly Swarm/Thorntail bundle WildFly 12 (and JSF 2.3)?

WildFly 12 launched in March 2018, and the Thorntail team typically aligns their releases with WildFly's main versions within 1-2 months. Since your current version is 2018.5.0, the next minor release (likely 2018.6.0 or a subsequent update) should upgrade the underlying WildFly base to 12, which will include JSF 2.3 out of the box without needing manual overrides.

To stay updated, keep an eye on the official release notes or project milestones—they clearly announce base WildFly version upgrades when they're planned.

内容的提问来源于stack exchange,提问作者Benjamin

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.27 06:53:34