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
Java 传递JSF参数时未实现setter方法_Java_Jsf 2 - Fatal编程技术网

Java 传递JSF参数时未实现setter方法

Java 传递JSF参数时未实现setter方法,java,jsf-2,Java,Jsf 2,我有一个带有commandlink的数据表,我想把一个对象传递给bean。commandlink上的action属性直接指向同一页,即没有导航。因此(我认为/怀疑),或者出于其他原因,bean中的setter方法没有被实现,因此我在bean中的对象为null。我怎样才能解决这个问题呢。下面是数据表、setter和我的方法的摘录。Thnx <h:commandLink value="Delete"actionListener="#bOQMasterManager.removeBOQ}" ac

我有一个带有commandlink的数据表,我想把一个对象传递给bean。commandlink上的action属性直接指向同一页,即没有导航。因此(我认为/怀疑),或者出于其他原因,bean中的setter方法没有被实现,因此我在bean中的对象为null。我怎样才能解决这个问题呢。下面是数据表、setter和我的方法的摘录。Thnx

<h:commandLink value="Delete"actionListener="#bOQMasterManager.removeBOQ}" action="boqmaster">
     <f:setPropertyActionListener target="#{bOQMasterManager.boqmasterPK}" 
        value="#{boqs.boqmasterPK}" />
   </h:commandLink>


public void setBoqmasterPK(BoqmasterPK boqmasterPK) {
     System.out.println("In the setter!!!");
    this.boqmasterPK = boqmasterPK;

}

public void removeBOQ(ActionEvent event) {
    try {
        System.out.println("In removeBOQ!!!");

        request.removeBoq(boqmasterPK);
        logger.info("Removed BOQ .");
    } catch (IllegalArgumentException e) {
        System.out.println("In the exception!!!"+e.getMessage());

    }
}

公共无效设置BoqmasterPK(BoqmasterPK BoqmasterPK){
System.out.println(“在setter!!!”;
this.boqmasterPK=boqmasterPK;
}
公共作废移除BOQ(ActionEvent事件){
试一试{
System.out.println(“In-removeBOQ!!!”;
请求移除BOQ(boqmasterPK);
logger.info(“已删除的工程量清单”);
}捕获(IllegalArgumentException e){
System.out.println(“在异常中!!!”+e.getMessage());
}
}
我希望首先

actionListener="#bOQMasterManager.removeBOQ}"

setBoqmasterPK
bOQMasterManager
Bean中定义,而
getBoqmasterPK
必须在
boq
中定义

public void setBoqmasterPK(BoqmasterPK boqmasterPK) {
    System.out.println("In the setter!!!");
    this.boqmasterPK = boqmasterPK;
}

也许向我们展示相关的jsf部分可以帮助我们分析“(我认为)bean中的setter方法没有被实现”是什么意思?很抱歉,我想我已经把jsf部分放进去了,让我来编辑这篇文章。未实现sorryIt setter。“已实现”或“已调用/已执行”。实现意味着已经编写了它的代码。
public void setBoqmasterPK(BoqmasterPK boqmasterPK) {
    System.out.println("In the setter!!!");
    this.boqmasterPK = boqmasterPK;
}