2009-11-25 77 views
0

ICEFaces + Liferay:我创建了两个war文件firstApp.war和secondApp.war文件并部署在liferay上。 我想实现,当我点击firstApp.war应用程序的页面上的提交按钮时,firstAppBacking bean应该在public-render-parameter中设置一些值,以便我可以在secondApp.war应用程序中获取该值,如IPC。请sugeest我如何设置firstAppText valiue。ICEFaces + Liferay:如何设置公共渲染参数的值

<portlet-app ....> 
<portlet> 
    <portlet-name>firstApp</portlet-name> 
    <display-name>First App</display-name> 
    <portlet-class>com.icesoft.faces.webapp.http.portlet.MainPortlet</portlet-class> 
    <init-param> 
     <name>com.icesoft.faces.VIEW</name> 
     <value>/jsp/firstApp.iface</value> 
    </init-param> 
    .... 
    **<supported-public-render-parameter>firstAppText</supported-public-render-parameter>** 
</portlet> 
<public-render-parameter> 
    <identifier>firstAppText</identifier> 
    <qname xmlns:x="http://www.liferay.com/public-render-parameters">x:firstAppText</qname> 
</public-render-parameter> 

回答

1

有几种方法可以做到这一点。首先,基本概念很好地描述了here

如您所见,您可以在不同的“上下文”中共享数据。一种方法是通过在portlet.xml中声明shared-portlet-session-attribute,例如通过会话来共享数据。

<shared-portlet-session-attribute> 
    <name>someName</name> 
    <java-class>com.some.class</java-class> 
<shared-portlet-session-attribute> 

共享数据的其他途径有: - PortletSession中 - PortletContext - 页面参数 - Portlet事件

的不同方式this book描述。我还没有尝试过所有这些,因此我现在不能提供更多细节。