【发布时间】:2017-08-20 00:16:00
【问题描述】:
我正在尝试将参数从 jsf 页面传递到另一个页面,但我调用的另一个页面甚至不会更改 URl,它只是将“#”添加到现有 url 中。 这是 index.xhtml
<h:commandLink value="details" action="#{ideeBean.details()}">
<f:param name="idee" value="in" />
</h:commandLink>
这是IdeeBean.java
public String details(){
return "details";
}
当我单击命令链接时,url 从 :http://localhost:8080/gidee/ 传递到 http://localhost:8080/gidee/#。
【问题讨论】:
-
您需要
h:outputLink使用f:param参数,或h:commandLink action="#{ideeBean.details(yourParameterValue1, yourParameterValue2)}"将参数传递给您的操作方法。 -
我想传递给 url localhost:8080/gidee/details.xhtml 所以 index.xhtml 中的方法 details() 是正确的吗?因为它传递给localhost:8080/gidee/#。
标签: jsf