其中的FacesMessage的FacesContext在Thorntail 2.3?

问题描述 投票:0回答:1

我正在开发测试任务,与堆栈:thorntail 2.3.0.Final,PrimeFaces 6.2。

还有例如:

public void onRowEdit(RowEditEvent event) {
    FacesMessage msg = new FacesMessage("Car Edited", ((Car) event.getObject()).getId());
    FacesContext.getCurrentInstance().addMessage(null, msg);
}

但我无法导入FacesMessageFacesContext,我的IDE无法找到他们所有的依赖

我的pom.xml thorntail与BOM的位:

…
    <dependency>
        <groupId>io.thorntail</groupId>
        <artifactId>cdi</artifactId>
    </dependency>
    <dependency>
        <groupId>io.thorntail</groupId>
        <artifactId>jpa</artifactId>
    </dependency>
    <dependency>
        <groupId>io.thorntail</groupId>
        <artifactId>jsf</artifactId>
    </dependency>
…

发生什么了?这是一些新的方法来这个包还是其他什么东西JSF 2.3?

我读过有关JSF 2.3,它具有新的功能和一些弃用。

也是在@ViewScoped?现在我们应该CDI使用什么样的?

当包import javax.faces.*

我糊涂了…

jsf java-ee thorntail
1个回答
2
投票

貌似在https://github.com/thorntail/thorntail/blob/master/fractions/javaee/jsf/pom.xml的错误不会添加JSF API,作为提供给您的应用程序依赖关系。

一个简单的办法是加入JSF的API在您的项目为“提供”,在运行时它们将被用于精细。

© www.soinside.com 2019 - 2024. All rights reserved.