Duplicated success alert from StrutsActionDuplicated success alert from StrutsActionhttps://liferay.dev/en/c/message_boards/find_thread?p_l_id=119785333&threadId=1199700642024-03-29T15:25:40Z2024-03-29T15:25:40ZDuplicated success alert from StrutsActionVáclav Suchánekhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1199700632020-09-18T11:43:42Z2020-09-18T11:43:42Z<html><head></head><body>Hello,<br><br>I have following scenario:<br>I have created a custom module where I applied StrutsAction:<br><br><pre><code>@Component(
immediate = true, property = "path=/portal/customModule/find_entry",
service = StrutsAction.class
)
public class FindEntryAction extends FindStrutsAction {...}</code></pre><br>Inside of it I'm overriding:<br><br><pre><code>@Override
public String execute(HttpServletRequest request, HttpServletResponse response) throws Exception {
SessionMessages.add(request, "request_processed", "test");
super.execute(request, response);
return null;
}</code></pre><br>And If i redeploy module and render it so the result is following:<br><br><img src="/documents/portlet_file_entry/14/image--tempRandomSuffix--7lYAx38g.png/8df67cfe-4846-c4df-5537-1a4f573e5092"><br><br>Alert Message is displayed six times. This number (6) is related to the number of rendered portlets on the page - for every portlet layout is this message rendered. I did some tests and if I remove one portlet from the page so there will be only 5 these messages rendered and so on.<br><br>It looks like a bug for me. But maybe I missed something.<br><br>Is there any other way how to add message to SessionMessages? Can I add some namespace or portlet id?<br><br><strong>Expected Result:</strong><br>Alert is displayed only once.<br><strong>Actual Result:<br></strong>Alert is displayed six times.<br><br>Tested on:<br>Liferay 7.3.4 GA5 (<a href="https://releases-cdn.liferay.com/portal/7.3.4-ga5/liferay-ce-portal-tomcat-7.3.4-ga5-20200811154319029.tar.gz">https://releases-cdn.liferay.com/portal/7.3.4-ga5/liferay-ce-portal-tomcat-7.3.4-ga5-20200811154319029.tar.gz</a>)<br>Server version: Apache Tomcat/9.0.33<br>OS Name: Windows 10<br>JVM Version: 1.8.0_144-b01<br>PostgreSQL<br>Maven workspace<br>IDE: IntelliJ IDEA 2020.2 (Ultimate Edition) Build #IU-202.6397.94, built on July 27, 2020<br><br>Thanks in advance.<br><br>Vaclav</body></ht