gpt4 book ai didi

jsf-2 - Primefaces 数据表过滤不起作用

转载 作者:行者123 更新时间:2023-12-01 07:38:17 26 4
gpt4 key购买 nike

这个问题在这里已经有了答案:





java.lang.NullPointerException at org.primefaces.component.datatable.feature.FilterFeature.filter

(1 个回答)


5年前关闭。




我正在尝试使用 Primefaces 5 制作表格过滤器,
但过滤不会发生并获得以下堆栈:

java.lang.NullPointerException at org.primefaces.component.datatable.feature.FilterFeature.filter(FilterFeature.java:136) at org.primefaces.component.datatable.feature.FilterFeature.encode(FilterFeature.java:105) at org.primefaces.component.datatable.DataTableRenderer.encodeEnd(DataTableRenderer.java:77) at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:919) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1903) at com.sun.faces.context.PartialViewContextImpl$PhaseAwareVisitCallback.visit(PartialViewContextImpl.java:559) at com.sun.faces.component.visit.PartialVisitContext.invokeVisitCallback(PartialVisitContext.java:183) at org.primefaces.component.api.UIData.visitTree(UIData.java:692) at javax.faces.component.UIComponent.visitTree(UIComponent.java:1740) at javax.faces.component.UIComponent.visitTree(UIComponent.java:1740) at com.sun.faces.context.PartialViewContextImpl.processComponents(PartialViewContextImpl.java:399) at com.sun.faces.context.PartialViewContextImpl.processPartial(PartialViewContextImpl.java:319) at org.primefaces.context.PrimePartialViewContext.processPartial(PrimePartialViewContext.java:60) at javax.faces.component.UIViewRoot.encodeChildren(UIViewRoot.java:1004) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1896) at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:425) at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131) at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120) at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:219) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:647) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:301) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at com.star.AuthFilter.doFilter(AuthFilter.java:42) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:503) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:136) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:74) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:516) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1015) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:652) at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:222) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1575) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1533) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)



我正在克隆primefaces展示 example但我没说对!

这是我的代码:
.xhtml 文件:
<p:dataTable id="tbl" var="sim" value="#{simulationLog.simulation}"
paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink}"
paginator="true" rows="10" style="margin-bottom:20px"
filteredValue="#{simulationLog.filtredSimulation}"
>
<p:column filterBy="#{sim.simId}" filterMatchMode="contains">
<f:facet name="header">
<h:outputText value="Id" />
</f:facet>
<p:commandLink value="#{sim.simId}" />
</p:column>

支持 bean :
@ManagedBean
@SessionScoped
public class SimulationLog implements Serializable {
.
.
.
private List<SimulationLog> simulation;
private List<SimulationLog> filtredSimulation;

public List<SimulationLog> getSimulation() {
return ParamsDAO.getSimulation(codeAgence);
}

public List<SimulationLog> getFiltredSimulation() {
return filtredSimulation;
}

public void setFiltredSimulation(List<SimulationLog> filtredSimulation) {
this.filtredSimulation = filtredSimulation;
}
.
.
.
}

最佳答案

我有同样的错误,可以通过用 <h:form> 包裹数据表来修复它.

关于jsf-2 - Primefaces 数据表过滤不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24765075/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com