JSF 2.3中的f:websocket [英] f:websocket in JSF 2.3

查看:258
本文介绍了JSF 2.3中的f:websocket的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图获取BalusC的JSF 2.3+示例(

I trying to get BalusC's JSF 2.3+ example (How can server push asynchronous changes to a HTML page created by JSF?) working using JBoss WildFly 12.0.0.Final

我添加了JBoss JSF JAR:

I have added the JBoss JSF JAR:

jboss-jsf-api_2.3_spec-2.3.3.SP1.jar

但是,当我尝试显示具有以下内容的XHTML页面时:

However when I try and display my XHTML page which has:

<h:form>
    <f:websocket channel="push">
        <f:ajax event="updateNotifications" render=":panelGridSelect" />
    </f:websocket>
</h:form>

我得到:

javax.faces.view.facelets.TagException:/enterProduct.xhtml @ 61,45 标记库支持名称空间: http://xmlns.jcp.org/jsf/core ,但是没有为姓名: 网络套接字

javax.faces.view.facelets.TagException: /enterProduct.xhtml @61,45 Tag Library supports namespace: http://xmlns.jcp.org/jsf/core, but no tag was defined for name: websocket

在IntelliJ IDEA中:

In IntelliJ IDEA the:

f:websocket

以红色显示,好像找不到吗?

is shown in red, as though it can't find it?

f:websocket的标记库在哪里?

Where is the taglib for f:websocket?

推荐答案

f:websocket自JSF 2.3起可用,尽管Wildfly 12包含一些 JavaEE 8功能,但默认情况下它以JavaEE 7模式启动只是"JSF 2.2".

f:websocket is available since JSF 2.3 and although Wildfly 12 contains some JavaEE 8 features, it by default starts in JavaEE 7 mode which is 'just' JSF 2.2.

摘自最近的 WildFly 12发行文档

默认情况下,WildFly 12以EE7模式启动.为了使用这些新功能,您必须启用EE8预览模式.这可以通过在启动过程中传递ee8.preview.mode属性来实现:

By default WildFly 12 launches in EE7 mode. In order to use these new capabilities you have to enable EE8 preview mode. This can be accomplished by passing the ee8.preview.mode property during startup:

./standalone.sh -Dee8.preview.mode=true

还有其他选项可以启用此功能.来自同一文档:

There are other options too to enable this. From the same docs:

或者,这可以通过使用新的standalone-ee8.xml配置启动服务器来实现,该配置仅在配置中包含该属性.

Alternatively, this can be achieved by launching the server using the new standalone-ee8.xml configuration, which simply includes the property in the config.

./standalone.sh -c standalone-ee8.xml

CLI还可以用于修改现有配置以添加此属性.例如:

The CLI can also be used to modify the existing configuration to add this property. For example:

embed-server --admin-only=true /system-property=ee8.preview.mode:add(value=true) stop-embedded-server

embed-server --admin-only=true /system-property=ee8.preview.mode:add(value=true) stop-embedded-server

然后您应该拥有JSF 2.3和f:websockets

You should then have JSF 2.3 and f:websockets

这篇关于JSF 2.3中的f:websocket的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆