Java 调用bean时,Primefaces远程命令时间延迟

Java 调用bean时,Primefaces远程命令时间延迟,java,performance,jsf,primefaces,remotecommand,Java,Performance,Jsf,Primefaces,Remotecommand,我在RemoteCommand校准bean方法时间延迟方面存在性能问题。 使用我们的xhtml页面PrimeFaces4.0,在运行时会加载大量 分成小组 <p:outputPanel id="runtime_panel" autoUpdate="true" /> RequestContext.getCurrentInstance().update("COMPONENT_ID_TO_UPDATE") )但也没有成功 RequestContext.getCurrentInstanc

我在RemoteCommand校准bean方法时间延迟方面存在性能问题。

使用我们的xhtml页面PrimeFaces4.0,在运行时会加载大量 分成小组

<p:outputPanel id="runtime_panel" autoUpdate="true" />
RequestContext.getCurrentInstance().update("COMPONENT_ID_TO_UPDATE")
)但也没有成功

RequestContext.getCurrentInstance().update("COMPONENT_ID_TO_UPDATE")
我不知道如何摆脱这种“豆子呼叫滞后”

我真的需要你的帮助。

通常你必须在
p:remoteCommand
上使用
process=@this
,否则它将提交整个
h:form
及其组件。
RequestContext.getCurrentInstance().update("COMPONENT_ID_TO_UPDATE")
因此最好将
p:remoteCommand
保持在单独的
h:form

RequestContext.getCurrentInstance().update("COMPONENT_ID_TO_UPDATE")
如果这也不起作用,您可以始终使用ManagedBean上的
RequestContext
update
方法来更新组件

RequestContext.getCurrentInstance().update("COMPONENT_ID_TO_UPDATE")
这个技巧使用remoteCommand加快了页面内容的开始加载速度。
Primefaces远程命令示例:

RequestContext.getCurrentInstance().update("COMPONENT_ID_TO_UPDATE")
<p:remoteCommand name="load_users"
                 process="@this"
                 update="@form"
                 actionListener="#{myBean.loadUsers}" />

参考: