<?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>attribute not passing from action to render phase | liferay 7.4</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=121813710" />
  <subtitle>attribute not passing from action to render phase | liferay 7.4</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=121813710</id>
  <updated>2026-04-05T10:34:41Z</updated>
  <dc:date>2026-04-05T10:34:41Z</dc:date>
  <entry>
    <title>RE: attribute not passing from action to render phase | liferay 7.4</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121840845" />
    <author>
      <name>Olaf Kock</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121840845</id>
    <updated>2023-06-03T20:18:55Z</updated>
    <published>2023-06-03T20:18:54Z</published>
    <summary type="html">&lt;p&gt;This question also came up internally, and a colleague referenced the
    &lt;a
    href="https://download.oracle.com/otndocs/jcp/portlet-3-final-spec/"&gt;portlet spec&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
  &lt;p&gt;14.1.2.5 Action-scoped Request Attributes&lt;br&gt; The Java Portlet
    Specification follows a model of separating concerns into different
    request processing phases, such as the action phase, the event
    phase, and the render phase. This provides a clean separation of the
    action semantics from the rendering of the content, however, it may
    create some issues with servlet-based applications that don’t follow
    this strict Model View-Controller pattern. Such applications in some
    cases assume that attributes that they set in the action phase will
    be accessible again when starting the rendering. The Java Portlet
    Specification provides the render parameters for such use cases, but
    some applications need to transport complex objects instead of
    strings. For such use cases the Java Portlet Specification provides
    the action-scoped request attributes  as container runtime option
    with the intent to provide portlets with these request attributes
    until a new action occurs. Section 8.4.4 Runtime Option
    javax.portlet actionScopedRequestAttributes on page 51 describes
    this option in more detail.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;And 8.4.4 contains this info:&lt;/p&gt;
&lt;blockquote&gt;
  &lt;p&gt;Portlets that want to leverage the action-scoped request attributes
    must to set the container runtime&lt;br&gt; option
    javax.portlet.actionScopedRequestAttributes to true, default is&lt;br&gt;
    false. In addition, the portlet may provide a value called
    numberOfCachedScopes where the&lt;br&gt; following value element must be a
    positive number indicating the number of scopes the portlets&lt;br&gt;
    wants to have cached by the portlet container. This value is a hint
    to the portlet container that&lt;br&gt; the portlet container may not be
    able to honor because of resource constraints. The order of the&lt;br&gt;
    values in the portlet deployment descriptor must be true,
    numberOfCachedScopes, &amp;lt;number&lt;br&gt; of cached scopes&amp;gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;...and it seems that another (more brute force) workaround goes
  through the original HttpServletRequest.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</summary>
    <dc:creator>Olaf Kock</dc:creator>
    <dc:date>2023-06-03T20:18:54Z</dc:date>
  </entry>
  <entry>
    <title>attribute not passing from action to render phase | liferay 7.4</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121813709" />
    <author>
      <name>manu tomar</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121813709</id>
    <updated>2023-05-25T12:52:48Z</updated>
    <published>2023-05-25T12:52:47Z</published>
    <summary type="html">&lt;p&gt;when I attribute in action phase is not passing to render phase.
  Below is the code snippet I used&lt;/p&gt;
&lt;p&gt;action class:&lt;/p&gt;
&lt;pre&gt;
actionRequest.setAttribute(&amp;quot;key&amp;quot;, &amp;quot;value&amp;quot;);&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;render method: &lt;/p&gt;
&lt;pre&gt;
renderRequest.getAttribute(&amp;quot;key&amp;quot;);&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Is the way changed in Liferay 7.4 to accomplish the same&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</summary>
    <dc:creator>manu tomar</dc:creator>
    <dc:date>2023-05-25T12:52:47Z</dc:date>
  </entry>
</feed>
