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
Jsf 2 Jsf页面无法调用bean';s法_Jsf 2_El_Managed Bean - Fatal编程技术网

Jsf 2 Jsf页面无法调用bean';s法

Jsf 2 Jsf页面无法调用bean';s法,jsf-2,el,managed-bean,Jsf 2,El,Managed Bean,我有一个非常简单的页面,它快把我逼疯了。 基本上,我有两个按钮在bean上调用方法,但每次我得到: javax.el.MethodNotFoundException:/vues/Vehicle/CreationVehicle.xhtml@49,94 action=“#{CreationVehicle.creer}”:找不到方法:fr.efrei.gpa.web.beans.vehiclue。ModificationVehiculeBean@1387498.creer() 这是我的控制器(我删除了

我有一个非常简单的页面,它快把我逼疯了。 基本上,我有两个按钮在bean上调用方法,但每次我得到:

javax.el.MethodNotFoundException:/vues/Vehicle/CreationVehicle.xhtml@49,94 action=“#{CreationVehicle.creer}”:找不到方法:fr.efrei.gpa.web.beans.vehiclue。ModificationVehiculeBean@1387498.creer()

这是我的控制器(我删除了导入)

这就是我的观点

<!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:ui="http://java.sun.com/jsf/facelets"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:cogepat="http://cogepat.com/facelets"
    xmlns:rich="http://richfaces.org/rich"
    xmlns:ccc="http://java.sun.com/jsf/composite/compositeForms"
    xmlns:cccg="http://java.sun.com/jsf/composite/compositeGeneral">

<ui:composition template="/templates/template.xhtml">
    <ui:param name="module" value="vehicules" />
    <ui:define name="title">
        #{msg.CreerUnProduit}
    </ui:define>

    <ui:define name="titreModule">
        #{msg.GestionVehicule}
    </ui:define>

    <ui:define name="onglets">
        <ul>
            <li>
                <a class="tab" href="#{facesContext.externalContext.requestContextPath}/vues/vehicule/rechercheVehicule.xhtml">#{msg.RechercherUnVehicule}</a>
            </li>
            <li>
                <a class="selectedTab" href="#{facesContext.externalContext.requestContextPath}/vues/vehicule/creationVehicule.xhtml">#{msg.CreerUnVehicule}</a>
            </li>
        </ul>
    </ui:define>

    <ui:define name="nav">
        <h:form>
            <h:commandLink id="link1" value="#{msg.vehicules}" action="rechercheVehicule.xhtml" />
                >#{msg.creation}
        </h:form>
    </ui:define>


    <ui:define name="titreOnglet">
        #{msg.FormCreationVehicule}
    </ui:define>

    <ui:define name="corpsContenu">
        <ccc:formVehicule bean="#{creationVehicule}" />
        <div class="boutons">
                <h:commandButton type="submit" value="#{msg.creer}" action="#{creationVehicule.creer}" />
                <h:commandButton type="submit" value="#{msg.annuler}" action="#{creationVehicule.annuler}" />
        </div>
        <br/><br/>
    </ui:define>

</ui:composition>
</html>

#{msg.CreerUnProduit}
#{msg.gestionvehicleue}
>#{msg.creation} #{msg.formCreationVehicleue}

所以当我点击其中一个按钮时,我得到了错误。 这很奇怪,因为我正在以相同的方式从其他页面调用其他bean中的方法

有什么想法吗? 谢谢

我用的是JDK 6u35, richfaces 4.2.1.最终版本, tomcat 7,
和JSF 2.1.6

再次查看异常消息,然后特别是类名:

fr.efrei.gpa.web.beans.vehicule.ModificationVehiculeBean@1387498.creer()
这不是您手头的
CreationVehicleBean
类的FQN。这表明您有另一个托管bean类
modificationVehicleBean
,它使用完全相同的托管bean名称,并在类加载中获得优先权和/或是托管bean注册中的最后一个


ModificationVehicleBean
类一个不同的托管bean名称应该可以解决这个问题。

哦,天哪,copyNpaste错误。你是上帝。但在我的辩护中,从我开始到现在已经13小时了。非常感谢。
fr.efrei.gpa.web.beans.vehicule.ModificationVehiculeBean@1387498.creer()