最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

jsf - Is Jakarta ee 10 compatible with Eclipse IDE for Enterprise Java and Web developers? -- do I miss a setting? - Stack Overf

programmeradmin0浏览0评论

If you start a dynamic web project in Eclipse EE 2024-12 you get the following settings:

.classpath

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
    <classpathentry kind="con" path=".eclipse.jdt.launching.JRE_CONTAINER/.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-21"/>
    <classpathentry kind="src" path="src/main/java"/>
    <classpathentry kind="con" path=".eclipse.jst.server.core.container/.jboss.ide.eclipse.as.core.server.runtime.runtimeTarget/WildFly 27.0 Runtime">
        <attributes>
            <attribute name="owner.project.facets" value="jst.web;jst.jsf"/>
        </attributes>
    </classpathentry>
    <classpathentry kind="con" path=".eclipse.jst.j2ee.internal.web.container"/>
    <classpathentry kind="con" path=".eclipse.jst.j2ee.internal.module.container"/>
    <classpathentry kind="output" path="build/classes"/>
</classpath>

.project:

    <?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
    <name>reproduction</name>
    <comment></comment>
    <projects>
    </projects>
    <buildSpec>
        <buildCommand>
            <name>.eclipse.jdt.core.javabuilder</name>
            <arguments>
            </arguments>
        </buildCommand>
        <buildCommand>
            <name>.eclipse.wstmon.project.facet.core.builder</name>
            <arguments>
            </arguments>
        </buildCommand>
        <buildCommand>
            <name>.eclipse.wst.validation.validationbuilder</name>
            <arguments>
            </arguments>
        </buildCommand>
    </buildSpec>
    <natures>
        <nature>.eclipse.jem.workbench.JavaEMFNature</nature>
        <nature>.eclipse.wstmon.modulecore.ModuleCoreNature</nature>
        <nature>.eclipse.wstmon.project.facet.core.nature</nature>
        <nature>.eclipse.jdt.core.javanature</nature>
        <nature>.eclipse.wst.jsdt.core.jsNature</nature>
    </natures>
</projectDescription>

the generated example index.xhtml:

<!-- this part is generated by Eclipse, and not JSF 4.0 compilant:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    ".dtd">

<html xmlns=";
    xmlns:ui=";
    xmlns:h=";
    xmlns:f=";>

not the below correct, nor the above incorrect URLs can get Eclipse to find the tag library; it gives the error: "Can't find the facelet tag library." And code completion doesn't work.

-->
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE html>
<html lang="en" 
      xmlns:h="jakarta.faces.html"
      xmlns:f="jakarta.faces.core"
      xmlns:ui="jakarta.faces.facelets">

<f:loadBundle basename="resources.application" var="msg"/>

<head>
    <title><h:outputText value="#{msg.welcomeTitle}" /></title>
</head>

<body>
<h3><h:outputText value="#{msg.welcomeHeading}" /></h3>
<p><h:outputText value="#{msg.welcomeMessage}" /></p>
</body>
</html>

So the above xhtml can not be validated by Eclipse, which makes sense, since you can not set the project to have JSF above 2.3 (and this is a 4.0+ feature)

JSF project nature only goes up to 2.3

How could I enable JSF 4.0 support?

If you start a dynamic web project in Eclipse EE 2024-12 you get the following settings:

.classpath

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
    <classpathentry kind="con" path=".eclipse.jdt.launching.JRE_CONTAINER/.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-21"/>
    <classpathentry kind="src" path="src/main/java"/>
    <classpathentry kind="con" path=".eclipse.jst.server.core.container/.jboss.ide.eclipse.as.core.server.runtime.runtimeTarget/WildFly 27.0 Runtime">
        <attributes>
            <attribute name="owner.project.facets" value="jst.web;jst.jsf"/>
        </attributes>
    </classpathentry>
    <classpathentry kind="con" path=".eclipse.jst.j2ee.internal.web.container"/>
    <classpathentry kind="con" path=".eclipse.jst.j2ee.internal.module.container"/>
    <classpathentry kind="output" path="build/classes"/>
</classpath>

.project:

    <?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
    <name>reproduction</name>
    <comment></comment>
    <projects>
    </projects>
    <buildSpec>
        <buildCommand>
            <name>.eclipse.jdt.core.javabuilder</name>
            <arguments>
            </arguments>
        </buildCommand>
        <buildCommand>
            <name>.eclipse.wstmon.project.facet.core.builder</name>
            <arguments>
            </arguments>
        </buildCommand>
        <buildCommand>
            <name>.eclipse.wst.validation.validationbuilder</name>
            <arguments>
            </arguments>
        </buildCommand>
    </buildSpec>
    <natures>
        <nature>.eclipse.jem.workbench.JavaEMFNature</nature>
        <nature>.eclipse.wstmon.modulecore.ModuleCoreNature</nature>
        <nature>.eclipse.wstmon.project.facet.core.nature</nature>
        <nature>.eclipse.jdt.core.javanature</nature>
        <nature>.eclipse.wst.jsdt.core.jsNature</nature>
    </natures>
</projectDescription>

the generated example index.xhtml:

<!-- this part is generated by Eclipse, and not JSF 4.0 compilant:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3./TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3./1999/xhtml"
    xmlns:ui="http://java.sun/jsf/facelets"
    xmlns:h="http://java.sun/jsf/html"
    xmlns:f="http://java.sun/jsf/core">

not the below correct, nor the above incorrect URLs can get Eclipse to find the tag library; it gives the error: "Can't find the facelet tag library." And code completion doesn't work.

-->
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE html>
<html lang="en" 
      xmlns:h="jakarta.faces.html"
      xmlns:f="jakarta.faces.core"
      xmlns:ui="jakarta.faces.facelets">

<f:loadBundle basename="resources.application" var="msg"/>

<head>
    <title><h:outputText value="#{msg.welcomeTitle}" /></title>
</head>

<body>
<h3><h:outputText value="#{msg.welcomeHeading}" /></h3>
<p><h:outputText value="#{msg.welcomeMessage}" /></p>
</body>
</html>

So the above xhtml can not be validated by Eclipse, which makes sense, since you can not set the project to have JSF above 2.3 (and this is a 4.0+ feature)

JSF project nature only goes up to 2.3

How could I enable JSF 4.0 support?

Share Improve this question edited Mar 3 at 11:52 BalusC 1.1m376 gold badges3.7k silver badges3.6k bronze badges asked Mar 2 at 9:05 zebaluzebalu 92 bronze badges 4
  • Java 21. Doesn't change a thing. I am talking about IDE feature support, not compilation error. I can also add TomEE 10, WildFly 33.0.2; I have tried them both. Other IDEs does not report error on the project, the code works fine. I can't set up Eclipse which I would prefer. – zebalu Commented Mar 2 at 12:11
  • 1 Please edit your question, remove all unrelated things and focus on one issue only. Avoid making assumptions. Please provide a complete minimal reproducible example. – howlger Commented Mar 2 at 15:20
  • Your original question was perfectly clear and understood to me. I guess others are simply upset by the ranty tone. Pay careful attention to the tone and don't post in weekends ;) – BalusC Commented Mar 3 at 11:51
  • @BalusC Thanks for removing the unrelated things which were also wrong. Actually, the original question was quite general and you only answered what was originally only mentioned as an example. – howlger Commented Mar 3 at 15:22
Add a comment  | 

1 Answer 1

Reset to default 1

Jakarta Faces API versions 3.0, 4.0, 4.1 are not yet supported by the Eclipse Web Tools Platform Project.

See the open issue of the Eclipse Tools for Faces project at GitHub:
Issue #8: Support newer Jakarta Faces API versions (3.0, 4.0, 4.1)

Note that this issue links to a pull request that was opened on January 12, 2025 and whose status is unclear.

Please consider to get involved in the open source software you use.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论