MVCPortlet, SessionMessages and RedirectMVCPortlet, SessionMessages and Redirecthttps://liferay.dev/c/message_boards/find_thread?p_l_id=119785333&threadId=1214282142024-03-29T02:01:07Z2024-03-29T02:01:07ZRE: MVCPortlet, SessionMessages and Redirectvinoth kumarhttps://liferay.dev/c/message_boards/find_message?p_l_id=119785333&messageId=1219044182023-12-28T09:30:54Z2023-07-05T11:59:11Z<p>In this case, Use your success message in redirected page. i.e</p>
<p><liferay-ui:success key="success" message="Greeting
saved successfully!" /> in your redirected page. So, you can
see the message in redirected page.</p>vinoth kumar2023-07-05T11:59:11ZMVCPortlet, SessionMessages and RedirectGennaro Lippiellohttps://liferay.dev/c/message_boards/find_message?p_l_id=119785333&messageId=1214282132022-05-23T11:27:10Z2022-05-23T11:27:08Z<p>Hello, in my custom MVCPortlet I have a view.jsp file with inside a
form which calls a function in my portlet.java file.<br /> After the
function, if everything is ok I'm calling the method
"SessionMessages.add(actionRequest,"success");" in
order to show a custom success message.</p>
<p>Everything works fine, but after the success message I need to
redirect the user on another page. So I thought to add a simple
redirect
"actionResponse.sendRedirect(themeDisplay.getURLPortal());"
after the method that shows the custom message. But in this way the
redirect is too fast and I have no time to read the success message.</p>
<p>Which is the best way to show the custom success messagge, give to
user enought time to read it, and then redirect the page?<br /> It
would be great if I can show the succes message in a popup, and only
when the user close the popup he will be redirected. Is this possible?</p>