Eclipse jsf managedBean javax.el.PropertyNotFoundException

时间:2017-11-28 14:09:00

标签: eclipse jsf jsf-2 xhtml

在一个简单的非maven jsf项目中,我有这个错误严重:javax.el.PropertyNotFoundException:/ form_tour.xhtml @ 13,49 value ="#{tourBean.kindOfTour}& #34; 引起:javax.el.PropertyNotFoundException:目标无法访问,标识符[tourBean]已解析为null 。我检查了bean类和xhtml,一切看起来都很好。

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:f="http://xmlns.jcp.org/jsf/core"
xmlns:p="http://primefaces.org/ui">
<h:head>
    <title>A Simple JavaServer Faces 2.0 View</title>
    <link rel="stylesheet" type="text/css" href="style.css" />
</h:head>
<h:body>
    <h:form>
        <p:outputLabel value="working" />
        <p:inputText value="#{tourBean.kindOfTour}" />
        <p:commandButton value="ok" />
    </h:form>
    <p:outputLabel value="#{tourBean.kindOfTour}" />
</h:body>
</html>

管理bean:

package com.fabio.bean;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
@ManagedBean
@SessionScoped
public class TourBean {

    private String kindOfTour;

    public TourBean() {

    }

    public String getKindOfTour() {
        return kindOfTour;
    }

    public void setKindOfTour(String kindOfTour) {
        this.kindOfTour = kindOfTour;
    }

}

我在javax.faces-2.2.8.jar的{​​{1}}文件夹中使用primefaces-6.1.jarlib,它们都正确地显示在WebContent的{​​{1}}下。我已经检查了this,但关于第一点(我的错误)的所有内容似乎都没问题。

完整的错误日志:

ibraries->web app libraries

0 个答案:

没有答案
相关问题