将PrimeFaces p:向导绑定到复合组件

时间:2013-03-18 15:41:32

标签: java jsf-2 binding primefaces composite-component

我需要从复合组件内部访问PrimeFaces向导。我使用Mojarra 2.1.13,PrimeFaces 3.4.2和Spring Web Flow 2.3.1.RELEASE。我的小脸看起来像这样:

<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:composite="http://java.sun.com/jsf/composite"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:p="http://primefaces.org/ui">
<composite:interface componentType="actionWizard">  
    <composite:attribute name="bean" type="java.lang.Object" required="true" />
    <composite:attribute name="name" type="java.lang.String" required="true" />
    <composite:attribute name="widgetVar" type="java.lang.String" required="true" />
    <composite:attribute name="header" type="java.lang.String" />    
</composite:interface>
<composite:implementation>
     <p:wizard id="#{cc.attrs.name}" widgetVar="#{cc.attrs.widgetVar}"
         flowListener="#{cc.onFlowProcess}" showStepStatus="false"
         showNavBar="true" binding="#{cc.wizard}">
         ... tabs
     </p:wizard>

</composite:implementation>  

以下是该组件的一部分:

@FacesComponent(value="actionWizard")  
public class ActionWizard extends UINamingContainer {
    ...
    private Wizard wizard;
    ...

    public ActionWizard() {     
    }

    public Wizard getWizard() {
        return wizard;
    }

    public void setWizard(Wizard wizard) {
        this.wizard = wizard;
    }

}

我收到错误:目标无法访问,标识符'cc'已解析为null -

org.springframework.webflow.execution.FlowExecutionException: Exception thrown in state 'accounts' of flow 'actions-acc-flow'
at org.springframework.webflow.engine.impl.FlowExecutionImpl.wrap(FlowExecutionImpl.java:571)
at org.springframework.webflow.engine.impl.FlowExecutionImpl.resume(FlowExecutionImpl.java:262)
at org.springframework.webflow.executor.FlowExecutorImpl.resumeExecution(FlowExecutorImpl.java:169)
at org.springframework.webflow.mvc.servlet.FlowHandlerAdapter.handle(FlowHandlerAdapter.java:183)
at org.springframework.faces.webflow.JsfFlowHandlerAdapter.handle(JsfFlowHandlerAdapter.java:48)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:923)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:789)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at com.geneous.client.web.servlet.ResourceAuthorizationFilter.doFilter(ResourceAuthorizationFilter.java:49)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1002)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: javax.faces.el.PropertyNotFoundException: javax.el.PropertyNotFoundException: /resources/custom/actionWizard.xhtml @21,73 binding="#{cc.wizard}": Target Unreachable, identifier 'cc' resolved to null
at javax.faces.component.ValueBindingValueExpressionAdapter.setValue(ValueBindingValueExpressionAdapter.java:154)
at org.springframework.faces.webflow.JsfViewFactory.processTree(JsfViewFactory.java:180)
at org.springframework.faces.webflow.JsfViewFactory.processTree(JsfViewFactory.java:185)
at org.springframework.faces.webflow.JsfViewFactory.processTree(JsfViewFactory.java:185)
at org.springframework.faces.webflow.JsfViewFactory.processTree(JsfViewFactory.java:185)
at org.springframework.faces.webflow.JsfViewFactory.processTree(JsfViewFactory.java:185)
at org.springframework.faces.webflow.JsfViewFactory.processTree(JsfViewFactory.java:185)
at org.springframework.faces.webflow.JsfViewFactory.processTree(JsfViewFactory.java:185)
at org.springframework.faces.webflow.JsfViewFactory.processTree(JsfViewFactory.java:185)
at org.springframework.faces.webflow.JsfViewFactory.processTree(JsfViewFactory.java:185)
at org.springframework.faces.webflow.JsfViewFactory.processTree(JsfViewFactory.java:185)
at org.springframework.faces.webflow.JsfViewFactory.getView(JsfViewFactory.java:111)
at org.springframework.webflow.engine.ViewState.resume(ViewState.java:193)
at org.springframework.webflow.engine.Flow.resume(Flow.java:545)
at org.springframework.webflow.engine.impl.FlowExecutionImpl.resume(FlowExecutionImpl.java:258)
... 28 more

0 个答案:

没有答案