我已經得到答案。
如果你想使用GET,使用此:由POST使用
<h:link value="take me to the page2" outcome="page2" />
或者:
<h:form>
<h:commandLink action="#{menager.navigateToPage2}" value="take me to the page2" />
</h:form>
和faces-config.xml中
<managed-bean>
<managed-bean-name>menadzer</managed-bean-name>
<managed-bean-class>test.Menadzer</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
<managed-property>
<property-name>symbolAktywnejSpolki</property-name>
<value>#{param.symbol}</value>
</managed-property>
</managed-bean>
<navigation-rule>
<display-name>index.xhtml</display-name>
<from-view-id>index.xhtml</from-view-id>
<navigation-case>
<from-action>#{menager.navigateToPage2}</from-action>
<from-outcome>page2</from-outcome>
<to-view-id>page2.xhtml</to-view-id>
</navigation-case>
</navigation-rule>
和類:
public class Menager {
...
public String navigateToPage2() {
return "page2";
}
}
如果您使用WebSphere Portal,請將其添加到faces-config.xml中:
<application>
<view-handler>com.ibm.faces20.portlet.FaceletPortletViewHandler</view-handler>
<resource-handler>com.ibm.faces20.portlet.httpbridge.PortletResourceHandler</resource-handler>
<el-resolver>com.ibm.faces20.portlet.PortletELResolver</el-resolver>
</application>