JSF 导航:带参数的动作
JSF navigation: from-action with args
对不起我的英语。我有一个 navigation-rule
:
<navigation-rule>
<from-view-id>/pages/test/*</from-view-id>
<navigation-case>
<from-action>#{testMB.delete}</from-action>
<from-outcome>success</from-outcome>
<to-view-id>/pages/test/index.xhtml</to-view-id>
</navigation-case>
</navigation-rule>
TestMB
:
public String delete(Test test){
return SUCCESS;
}
和test.xhtml
:
<h:commandLink action="#{testMB.delete(testMB.instance)}">del</h:commandLink>
我点击 del
但规则不起作用。如果我使用不带参数的删除方法 Test test
:
public String delete(){
return SUCCESS;
}
正在运行。如何与 arg 一起使用?
我在javaserverfaces的jira中添加了问题。我有答案:
请参考h:commandLink
的VDL文档。在那里你会看到对动作属性类型的要求。
javax.el.MethodExpression
(签名必须匹配java.lang.Object action()
)
您正在尝试传递不受支持的方法参数。
对不起我的英语。我有一个 navigation-rule
:
<navigation-rule>
<from-view-id>/pages/test/*</from-view-id>
<navigation-case>
<from-action>#{testMB.delete}</from-action>
<from-outcome>success</from-outcome>
<to-view-id>/pages/test/index.xhtml</to-view-id>
</navigation-case>
</navigation-rule>
TestMB
:
public String delete(Test test){
return SUCCESS;
}
和test.xhtml
:
<h:commandLink action="#{testMB.delete(testMB.instance)}">del</h:commandLink>
我点击 del
但规则不起作用。如果我使用不带参数的删除方法 Test test
:
public String delete(){
return SUCCESS;
}
正在运行。如何与 arg 一起使用?
我在javaserverfaces的jira中添加了问题。我有答案:
请参考h:commandLink
的VDL文档。在那里你会看到对动作属性类型的要求。
javax.el.MethodExpression
(签名必须匹配java.lang.Object action()
)
您正在尝试传递不受支持的方法参数。