Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/jsf/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jsf-2/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/visual-studio-2010/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
JSF2-javax.el.PropertyNotFoundException。不使用方法_Jsf_Jsf 2_Icefaces - Fatal编程技术网

JSF2-javax.el.PropertyNotFoundException。不使用方法

JSF2-javax.el.PropertyNotFoundException。不使用方法,jsf,jsf-2,icefaces,Jsf,Jsf 2,Icefaces,当我尝试渲染视图时,浏览器显示此错误 01:46:11,371 GRAVE [javax.enterprise.resource.webcontainer.jsf.application] (http--127.0.0.1-8080-1) Error Rendering View[/index.xhtml]: javax.el.PropertyNotFoundException: /index.xhtml @15,74 value="#{actividades.getAll}": The cla

当我尝试渲染视图时,浏览器显示此错误

01:46:11,371 GRAVE [javax.enterprise.resource.webcontainer.jsf.application] (http--127.0.0.1-8080-1) Error Rendering View[/index.xhtml]: javax.el.PropertyNotFoundException: /index.xhtml @15,74 value="#{actividades.getAll}": The class 'org.pfc.controller.principal.ActividadesController' does not have the property 'getAll'.
at com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:111) [jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAPSHOT]
ACTVIDAD控制器代码

@ManagedBean(name="actividades")
@ViewScoped public class ActividadesController implements Serializable {

    private static final long serialVersionUID = 1L;

    private final static Log logger=LogFactory.getLog(ActividadesController.class);

    @ManagedProperty(value="#{actividadBO}")
    private ActividadBO actividad;



    public void setActividad(ActividadBO actividad) {
        this.actividad = actividad;
    }

    public List<Actividad> getAll(){

        logger.trace("ActividadesController.getAll");

        return actividad.getAll();
    }
}
    <h:body>
        <ui:composition template="/WEB-INF/templates/main-template.xhtml">
            <ui:define name="content">
                <h:dataTable value="#{actividades.getAll}" var="actividad">
                    <h:column>
                        <f:facet name="header">
                            <h:outputText>Título</h:outputText>
                        </f:facet>
                        <h:outputText value="{actividad.titulo}"></h:outputText>
                    </h:column>
                </h:dataTable>
            </ui:define>
        </ui:composition>
</h:body>
@ManagedBean(name=“actividades”)
@ViewScope公共类ActividadesController实现可序列化{
私有静态最终长serialVersionUID=1L;
私有最终静态日志记录器=LogFactory.getLog(ActividadesController.class);
@ManagedProperty(value=“#{actividadBO}”)
私人活动;
公共无效设置actividad(ActividadBO actividad){
this.actividad=actividad;
}
公共列表getAll(){
trace(“ActividadesController.getAll”);
返回actividad.getAll();
}
}
查看代码

@ManagedBean(name="actividades")
@ViewScoped public class ActividadesController implements Serializable {

    private static final long serialVersionUID = 1L;

    private final static Log logger=LogFactory.getLog(ActividadesController.class);

    @ManagedProperty(value="#{actividadBO}")
    private ActividadBO actividad;



    public void setActividad(ActividadBO actividad) {
        this.actividad = actividad;
    }

    public List<Actividad> getAll(){

        logger.trace("ActividadesController.getAll");

        return actividad.getAll();
    }
}
    <h:body>
        <ui:composition template="/WEB-INF/templates/main-template.xhtml">
            <ui:define name="content">
                <h:dataTable value="#{actividades.getAll}" var="actividad">
                    <h:column>
                        <f:facet name="header">
                            <h:outputText>Título</h:outputText>
                        </f:facet>
                        <h:outputText value="{actividad.titulo}"></h:outputText>
                    </h:column>
                </h:dataTable>
            </ui:define>
        </ui:composition>
</h:body>

蒂图罗
我使用JBoss7,我的项目有el-impl2.2.jar、el-api.1.1.jar和icefaces3库

我不明白为什么渲染不起作用

有什么建议吗

亲切的问候。

这里

<h:dataTable value="#{actividades.getAll}" var="actividad">
或者,如果您使用的是EL 2.2(但不建议使用这种方式)

另见:
private List<Actividad> all;

@PostConstruct
public void init() {
    all = actividad.getAll();
}

public List<Actividad> getAll(){
    logger.trace("ActividadesController.getAll");
    return all;
}