<?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>Communication between Login BaseMVCActionCommand and Filter [Liferay 7.2]</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=119710648" />
  <subtitle>Communication between Login BaseMVCActionCommand and Filter [Liferay 7.2]</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=119710648</id>
  <updated>2026-04-04T08:55:54Z</updated>
  <dc:date>2026-04-04T08:55:54Z</dc:date>
  <entry>
    <title>RE: Communication between Login BaseMVCActionCommand and Filter [Liferay 7.</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119720686" />
    <author>
      <name>Christoph Rabel</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119720686</id>
    <updated>2020-08-06T08:30:42Z</updated>
    <published>2020-08-06T08:30:42Z</published>
    <summary type="html">Can you check if your filter is called in the same request? You probably can test this by throwing an exception in the action and the stacktrace should show your filter in it. Maybe exact timespamps help too, your filter should be after the Action.&lt;br /&gt;Wild guess: The Request is often wrapped in a HttpServletRequestWrapper, maybe you need to check the &amp;#34;inner&amp;#34; requests.&lt;br /&gt;&lt;table&gt;&lt;tr&gt;&lt;td&gt;HttpServletRequest wrappedHttpServletRequest = httpServletRequest;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/table&gt;&lt;table&gt;&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/table&gt;&lt;table&gt;&lt;tr&gt;&lt;td&gt;while (wrappedHttpServletRequest instanceof HttpServletRequestWrapper) {&lt;br /&gt;// Add debug info here, check session&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/table&gt;&lt;table&gt;&lt;tr&gt;&lt;td&gt;&lt;table&gt;&lt;tr&gt;&lt;td&gt;wrappedHttpServletRequest =&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/table&gt;(HttpServletRequest)httpServletRequestWrapper.getRequest();&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;table&gt;&lt;tr&gt;&lt;td&gt;}&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
    <dc:creator>Christoph Rabel</dc:creator>
    <dc:date>2020-08-06T08:30:42Z</dc:date>
  </entry>
  <entry>
    <title>RE: Communication between Login BaseMVCActionCommand and Filter [Liferay 7.</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119720003" />
    <author>
      <name>Antonio Suano</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119720003</id>
    <updated>2020-08-06T08:17:31Z</updated>
    <published>2020-08-06T08:17:31Z</published>
    <summary type="html">I&amp;#39;ve considered using Session, but for some reason I can&amp;#39;t get it to work. For example, I pass the variables in the Action like this:&lt;br /&gt;&lt;br /&gt;HttpServletRequest httpServletRequest = PortalUtil.getOriginalServletRequest(PortalUtil.getHttpServletRequest(actionRequest));&lt;br /&gt;httpServletRequest.getSession().setAttribute(&amp;#34;foo&amp;#34;, foo);&lt;br /&gt;&lt;br /&gt;And retrieve it in the Filter like this:&lt;br /&gt;HttpServletRequest request = (HttpServletRequest) servletRequest;&lt;br /&gt;HttpSession session = request.getSession(false);&lt;br /&gt;String foo = (String) session.getAttribute(&amp;#34;foo&amp;#34;);&lt;br /&gt;&lt;br /&gt;But it always returns null. Any idea what&amp;#39;s happening?</summary>
    <dc:creator>Antonio Suano</dc:creator>
    <dc:date>2020-08-06T08:17:31Z</dc:date>
  </entry>
  <entry>
    <title>RE: Communication between Login BaseMVCActionCommand and Filter [Liferay 7.</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119716594" />
    <author>
      <name>Christoph Rabel</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119716594</id>
    <updated>2020-08-06T07:14:23Z</updated>
    <published>2020-08-06T07:14:23Z</published>
    <summary type="html">You could write the information in the session (Request Scope is probably sufficient) and retrieve it later on.</summary>
    <dc:creator>Christoph Rabel</dc:creator>
    <dc:date>2020-08-06T07:14:23Z</dc:date>
  </entry>
  <entry>
    <title>RE: Communication between Login BaseMVCActionCommand and Filter [Liferay 7.</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119717613" />
    <author>
      <name>Antonio Javier Ortega Pérez</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119717613</id>
    <updated>2020-08-06T06:51:44Z</updated>
    <published>2020-08-06T06:51:44Z</published>
    <summary type="html">Hi. I have exactly the same problem. Did you solve it? Does anyone have any ideas?</summary>
    <dc:creator>Antonio Javier Ortega Pérez</dc:creator>
    <dc:date>2020-08-06T06:51:44Z</dc:date>
  </entry>
  <entry>
    <title>Communication between Login BaseMVCActionCommand and Filter [Liferay 7.2]</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119710647" />
    <author>
      <name>Antonio Suano</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119710647</id>
    <updated>2020-08-05T09:35:43Z</updated>
    <published>2020-08-05T09:35:43Z</published>
    <summary type="html">Hello,I&amp;#39;m currently migrating code from 6.2 to 7.2, and I&amp;#39;ve found myself stuck on something that should be trivial, but can&amp;#39;t find a solution. &lt;br /&gt;&lt;br /&gt;I have a BaseMVCActionCommand for the login action, where I recover three variables. Thus far, nothing troublesome, but now I need to pass these variables to a Filter class which is invoked on a certain range of urls to do some operations. Any ideas how to do this?</summary>
    <dc:creator>Antonio Suano</dc:creator>
    <dc:date>2020-08-05T09:35:43Z</dc:date>
  </entry>
</feed>
