微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

升级后未调用 Primefaces ajax 侦听器

如何解决升级后未调用 Primefaces ajax 侦听器

在 Primefaces 从 6.0 升级到 8.0 以及 WildFly 升级以使用 JakartaEE 之后,我的 ajax 事件侦听器不再被调用。但是 Age of male students: [21,19,24,22,20,23,18] Age of female students: [17,17,19] The common ages are: 19 The common ages are: 22 onsuccess JS 会被执行。

我的 XHTML:

oncomplete

我的豆子:

<html xmlns="http://www.w3.org/1999/xhtml"
  xmlns:h="http://xmlns.jcp.org/jsf/html"
  xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
  xmlns:cc="http://xmlns.jcp.org/jsf/composite"
  xmlns:p="http://primefaces.org/ui"
  xmlns:f="http://xmlns.jcp.org/jsf/core"
  xmlns:pe="http://primefaces.org/ui/extensions">
<h:body>
    <ui:composition template="/WEB-INF/template.xhtml">
        <ui:define name="container">
            <p:graphicImage id="myImage" library="projectLib" name="logo.png"/>
            <pe:imageAreaSelect id="areaSelect" for="myImage" handles="true">
                <p:ajax event="selectEnd" listener="#{testBean.selectEndListener}" oncomplete="console.log('complete')" onsuccess="console.log('success')"/>
            </pe:imageAreaSelect>
        </ui:define>
    </ui:composition>
</h:body>
</html>

在服务器日志中没有发现任何异常。在我的浏览器控制台中,我看到以下警告:

[弃用] 主线程上的同步 XMLHttpRequest 已弃用,因为它对最终用户的体验有不利影响。如需更多帮助,请查看 https://xhr.spec.whatwg.org/

谁能告诉我出了什么问题?

  • 基本面:8.0
  • Primefaces 扩展:8.0.4
  • JSF:jboss-jsf-api_2.3_spec
  • WildFly:21.0.2.Final

解决方法

我遇到了同样的问题,但这是在我将 Wildfly session-cookie 配置为 http-only=true 和 secure=true 之后,撤消此操作后,mi 应用程序再次运行。

PF 7.0.17 野蝇20

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。