WebSphere Portal 8.0上一个portlet中的jsf页面之间的导航 [英] navigation between jsf pages within one portlet on WebSphere Portal 8.0
问题描述
我正在使用WebSphere Portal 8.0,并且正在尝试制作几乎没有面孔的portlet. 谁能和我分享如何在一个portlet中建立到其他JSF站点的简单链接? 我的意思是,我正在尝试使用它,但是它不起作用:
I'm working on WebSphere Portal 8.0 and I am trying to make portlet with few faces. Can anyone share with me how can I make a simple link to other JSF site within one portlet? I mean, I was trying to use this, but it doesn't work:
<h:outputLink value="page2.xhtml">
<h:outputText value="take me to the page2" />
</h:outputLink>
我被重定向到了错误的链接,但是我想留在同一个站点上,但是要在此单个portlet中更改外观.
I'm redirected to the misterious link but I would like to stay on the same site but change face in this single portlet.
推荐答案
我有答案.
如果您想使用GET,请使用以下命令:
If you want use GET, use this:
<h:link value="take me to the page2" outcome="page2" />
或通过POST使用:
<h:form>
<h:commandLink action="#{menager.navigateToPage2}" value="take me to the page2" />
</h:form>
和faces-config.xml中的
and in 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:
and if you use WebSphere Portal add this, to the 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>
这篇关于WebSphere Portal 8.0上一个portlet中的jsf页面之间的导航的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!