<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>Using Liferay + JSF + CDI across different plugins.</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=111697568" />
  <subtitle>Using Liferay + JSF + CDI across different plugins.</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=111697568</id>
  <updated>2026-04-03T19:54:36Z</updated>
  <dc:date>2026-04-03T19:54:36Z</dc:date>
  <entry>
    <title>RE: Using Liferay + JSF + CDI across different plugins.</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111709179" />
    <author>
      <name>Javier Martin</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111709179</id>
    <updated>2018-11-30T10:48:11Z</updated>
    <published>2018-11-30T10:48:11Z</published>
    <summary type="html">&lt;p&gt;Hi Kile, thanks for you answer,&lt;/p&gt;
&lt;p&gt;I will have on consideration all your recommendations, we have
  already configured some portlets in different plugins using IPC events
  with success results, and for me is a very clean solution to cover
  certain requirements but this part of IPC using JSF is a bit unknown
  for me and we are preparing some stress benchmarks to check the final
  behavior of JSF - IPC under high load conditions.&lt;/p&gt;
&lt;p&gt;Another requirements need to share information between different
  plugins, and to use events is not the best fit for me. In relation to
  the public render parameter, and inside the documentation of JSF - IPC
  https://dev.liferay.com/fr/develop/tutorials/-/knowledge_base/6-2/communicating-between-jsf-portlets-using-ipc
  , I read that:&lt;/p&gt;
&lt;p&gt;&amp;quot;The Public Render Parameters technique provides a way for
  portlets to share data by setting public/shared parameter names in a
  URL controlled by the portal. While the benefit of this approach is
  that it is relatively easy to implement, the drawback is that only
  small amounts of data can be shared. Typically the kind of data that
  is shared is simply the value of a database primary key. &amp;quot;&lt;/p&gt;
&lt;p&gt;Sadly is not my case because my final targets is to do a
  transactional flow process with a distributive layer components and we
  need that the information reside on session container or a different
  container linked to the session. However the objects used across the
  transactional flow have a size of 2K - 8K, too expensive and small
  (size/latency) to store in database storage and too large to set in a
  public render parameter.&lt;/p&gt;
&lt;p&gt;Taking with priority your recommendations I will study to add new
  ways of solution to set my final design.&lt;/p&gt;
&lt;p&gt;Thanks so much and regards.&lt;/p&gt;</summary>
    <dc:creator>Javier Martin</dc:creator>
    <dc:date>2018-11-30T10:48:11Z</dc:date>
  </entry>
  <entry>
    <title>RE: Using Liferay + JSF + CDI across different plugins.</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111702880" />
    <author>
      <name>Kyle Joseph Stiemann</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111702880</id>
    <updated>2018-11-29T22:53:41Z</updated>
    <published>2018-11-29T22:53:41Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;&lt;p&gt;Hi Javier,&lt;br&gt; In order to share session data between two portlets
  (in the same WAR) in a standardized way, you can use &lt;a href="https://www.theserverside.com/tutorial/Application_Scope-versus-Portlet_Scope-Understanding-the-JSR-286-PortletSession"&gt;&lt;code&gt;PortletSession.APPLICATION_SCOPE&lt;/code&gt;&lt;/a&gt;:&lt;/p&gt;
&lt;pre class="prettyprint"&gt;
&lt;code class="hljs avrasm"&gt;PortletSession portletSession = (PortletSession) facesContext&amp;lt;span class="hljs-preprocessor"&amp;gt;.getExternalContext&amp;lt;/span&amp;gt;()&amp;lt;span class="hljs-preprocessor"&amp;gt;.getSession&amp;lt;/span&amp;gt;(true)&amp;lt;span class="hljs-comment"&amp;gt;;&amp;lt;/span&amp;gt;
portletSession&amp;lt;span class="hljs-preprocessor"&amp;gt;.setAttribute&amp;lt;/span&amp;gt;(“key”, “value”, PortletSession&amp;lt;span class="hljs-preprocessor"&amp;gt;.APPLICATION&amp;lt;/span&amp;gt;_SCOPE)&amp;lt;span class="hljs-comment"&amp;gt;;&amp;lt;/span&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If your portlets are not in the same WAR there is no standards-based
  way to share session attributes. Instead you should place the portlets
  into the same WAR. Or you can &lt;a href="https://dev.liferay.com/develop/tutorials/-/knowledge_base/6-2/communicating-between-jsf-portlets-using-ipc"&gt;use
    Events or Public Render Paramaters to communicate between the
    portlets (IPC)&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Liferay does have&amp;nbsp;a&amp;nbsp;non-standard feature&amp;nbsp;that supports session
  sharing:
  &lt;code&gt;&amp;amp;lt;private-session-attributes&amp;amp;gt;true&amp;amp;lt;/private-session-attributes&amp;amp;gt;&lt;/code&gt;&amp;nbsp;(in &lt;strong&gt;
    &lt;code&gt;liferay-portlet.xml&lt;/code&gt;&lt;/strong&gt;).&amp;nbsp;However this feature has
  not been tested with Liferay Faces and, &lt;a href="https://issues.liferay.com/browse/FACES-248?jql=project%20%3D%20FACES%20AND%20text%20~%20private-session-attributes"&gt;as
    far as we’re aware, it does not work with Liferay Faces&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;
  &lt;strong&gt;I recommend that you try moving to the appropriate IPC
    approach (Events or Public Render Parameters instead).&lt;/strong&gt; I’ll
  quote &lt;a href="https://community.liferay.com/forums/-/message_boards/message/86459517"&gt;David
    Nebinger on session usage&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
  &lt;p&gt;Session storage negatively affects your nodes ability to serve
    users. Plus you either need to replicate session throughout the
    cluster (another performance hit and resource consumer) or be okay
    with losing session data if the node crashes.&lt;br&gt; &amp;nbsp;&lt;br&gt; It seems
    like an easy way to span requests (and in your case share data), but
    therein lies the trap.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Avoid using the session if at all possible.&lt;/p&gt;
&lt;p&gt;- Kyle&lt;br&gt;
  &lt;br&gt; P.S. I don't think that&amp;nbsp;cdi-portlet-bridge-shared is necessary
  for your configuration (although Liferay 6.2 + Wildfly is not
  officially supported anyway)&amp;nbsp;and I don't think you are using the
  correct versions&amp;nbsp;of our Liferay Faces jars. Please go to &lt;a href="https://liferayfaces.org"&gt;liferayfaces.org&lt;/a&gt; to determine the
  correct versions.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Kyle Joseph Stiemann</dc:creator>
    <dc:date>2018-11-29T22:53:41Z</dc:date>
  </entry>
  <entry>
    <title>Using Liferay + JSF + CDI across different plugins.</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111697567" />
    <author>
      <name>Javier Martin</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111697567</id>
    <updated>2018-11-29T10:03:54Z</updated>
    <published>2018-11-29T10:03:54Z</published>
    <summary type="html">&lt;p&gt;Hi all,&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;I am working in a project that have different plugins, all plugins
  works with JSF+CDI. When I work with injected beans inside the same
  plugin context, the system works fine. But I would like to extend this
  capabilities to use the same beans instances across different plugins
  as SessionScoped and ApplicationScoped.&lt;/p&gt;
&lt;p&gt;I have declared a new module in Wildfly and declared in the
  jboss-deployment-structure.xml to be imported at the deploying time
  and to be reused by different plugins. In other words the same class
  loader definition is shared across all plugins.&lt;/p&gt;
&lt;p&gt;But when my code in plugin 1 generate a new bean (Ej: SessionScoped
  bean) for an interface and class declared in the wildfly module, this
  bean is not injected in the plugin 2. Using the inspection of Weld
  Probe tool i saw that the beans are not vissible from each other from
  different plugins.&lt;/p&gt;
&lt;p&gt;To solve this situation I have built two custom scopes
  (PortalSessionScoped and PortalRequestScoped) as Weld extension that
  works fine across different plugins, but I would like to use a more
  standard solution that custom scopes if possible.&lt;/p&gt;
&lt;p&gt;Is there a specific configuration using the Liferay components to do
  that I need without coding my own CDI extension? ( I have discarded to
  use DeltaSpike)&lt;/p&gt;
&lt;p&gt;My project configuration.&lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;Liferay 6.2.5 GA6 (Patched to work fine)&lt;/li&gt;
  &lt;li&gt;CDI 1.2 (Weld 2.4.7)&lt;/li&gt;
  &lt;li&gt;JSF 2.2 (Mojrarra 2.2.17)&lt;/li&gt;
  &lt;li&gt;Wildfly 10.1&lt;/li&gt;
  &lt;li&gt;JDK 8&lt;/li&gt;
  &lt;li&gt;Liferay Faces Components (Bridges extension 3.0.1 , Liferay Faces
    Portal 2.0.1, Bridge Impl 4.1.1, Faces Alloy 2.0.1, Faces Util
    3.1.0, cdi-portlet-bridge-shared .6.2.0.2)&lt;/li&gt;&lt;/ol&gt;
&lt;p&gt;Thanks and regards.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</summary>
    <dc:creator>Javier Martin</dc:creator>
    <dc:date>2018-11-29T10:03:54Z</dc:date>
  </entry>
</feed>
