Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/react-native/7.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 <;h:commandButton值=";。。。?用户标识=#{…}”;_Jsf - Fatal编程技术网

Jsf <;h:commandButton值=";。。。?用户标识=#{…}”;

Jsf <;h:commandButton值=";。。。?用户标识=#{…}”;,jsf,Jsf,整个语法如下所示 <h:commandLink action="CustomerDetails?faces-redirect=true&amp;customerId=#{item.id}" value="#{item.name}"/> 它似乎不允许我连接字符串和EL表达式。在值属性内完成的许多操作,必须是具有操作属性的。有人找到了解决方案吗?尝试在h:链接中使用f:param来设置customerId,这是设置查询参数的标准方法。 因此: 不错,但我认为行动应该改为结果。

整个语法如下所示

<h:commandLink action="CustomerDetails?faces-redirect=true&amp;customerId=#{item.id}" value="#{item.name}"/>

它似乎不允许我连接字符串和EL表达式。在
属性内完成的许多操作,必须是具有
操作
属性的。有人找到了解决方案吗?

尝试在h:链接中使用f:param来设置customerId,这是设置查询参数的标准方法。 因此:



不错,但我认为
行动
应该改为
结果
。不要认为h:link中有动作。我应该提到,出现错误的原因是,当JSF在h:commandLink的“action”属性中看到一个EL表达式时,它会立即假定您正在向它传递一个返回动作字符串的Java方法。也就是说,在“action”属性中,您不能将文本与EL混合。很抱歉这么挑剔,但我认为不需要faces redirect=true,因为这是一个显式导航,不需要在此处强制重定向。这里不需要PRG。这是正确的。我知道这一点,但出于某种原因,我没有想到这一点。我的问题应该是-1。太迟钝了为我指出这一点,谢谢
Not a Valid Method Expression: CustomerDetails?faces-redirect=true&customerId=#{item.id}
<h:link outcome="CustomerDetails" value="#{item.name}">
    <f:param name="customerId" value="#{item.id}" />
</h:link>