我正在使用通过将请求参数传递给页面来选择活动索引的选项卡:
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.org/ui">
<p:tabMenu activeIndex="${param.i}" style="text-decoration: none">
<p:menuitem value="Home" outcome="/home.xhtml">
<f:param name="i" value="0"/>
</p:menuitem>
<p:menuitem value="Sign" outcome="/web/sign/SelectServer.xhtml">
<f:param name="i" value="1"/>
</p:menuitem>
<p:menuitem value="Certificate Management" outcome="/web/sign/FileUpload.xhtml">
<f:param name="i" value="2" />
</p:menuitem>
<p:menuitem value="Support" outcome="/web/sign/FileUpload.xhtml">
<f:param name="i" value="3" />
</p:menuitem>
<p:menuitem value="Admin" outcome="/web/sign/FileUpload.xhtml">
<f:param name="i" value="4" />
</p:menuitem>
</p:tabMenu>
</ui:composition>
问题是它在URL中显示如下: /CodesignWebApp/faces/web/sign/SelectServer.xhtml?i=1
看起来不太好。有没有办法把这个参数传递给隐藏。我在f:param中看不到这样做的选项。或者我是否必须使用managed-bean来实现这一目标?