Upgrade originalStrutsPortletAction.processAction to MVCCommands codeUpgrade originalStrutsPortletAction.processAction to MVCCommands codehttps://liferay.dev/en/c/message_boards/find_thread?p_l_id=119785333&threadId=1195388882024-03-28T15:35:02Z2024-03-28T15:35:02ZRE: Upgrade originalStrutsPortletAction.processAction to MVCCommands codemajdi Achourihttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1195462982020-07-06T13:28:27Z2020-07-06T13:28:27ZHi all,<br /><br />Thanks for the reply: <br />I found the solution like @Mohamed Yasine suggest but a little improved: <br /><br /><br />@Reference(target = "(&(mvc.command.name=/login/login)(javax.portlet.name=+" + LoginPortletKeys.LOGIN<br /> + ") (javax.portlet.name=" + LoginPortletKeys.FAST_LOGIN + "))")<br /> public void setMvcActionCommand(MVCActionCommand mvcActionCommand) {<br /> this.mvcActionCommand = mvcActionCommand;<br /> } <br /><br />public MVCActionCommand getMvcActionCommand() {<br /> return this.mvcActionCommand;<br /> } <br /><br />protected MVCActionCommand mvcActionCommand;<br /><br />and the equivalent of <em><strong><strong>originalStrutsPortletAction.processAction(originalStrutsPortletAction, portletConfig, actionRequest, actionResponse); </strong></strong></em>is using the new <br /><br /><em><strong>mvcActionCommand.processAction(actionRequest, actionResponse);<br /><br />+1 Mohamed</strong></em><em><strong><strong></strong></strong></em>majdi Achouri2020-07-06T13:28:27ZRE: Upgrade originalStrutsPortletAction.processAction to MVCCommands codeOlaf Kockhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1195459482020-07-06T11:59:21Z2020-07-06T11:59:21Z<div class="quote-title">majdi Achouri:</div><blockquote><br />My question is which code can replace this old struts code? <br /></blockquote><br />My take on this: This is the wrong question. The implementation has changed dramatically. <br />You'll have to evaluate what kind of modification you implemented first.<br />Then check if Liferay has introduced an extension point for exactly your usecase. In case it's there: Change your implementation to adapt the new API. Otherwise evaluate how else to implement your requirements.<br />Don't assume that you should just replace your existing code 1:1 - that will make future maintenance so much harder.Olaf Kock2020-07-06T11:59:21ZRE: Upgrade originalStrutsPortletAction.processAction to MVCCommands codeMohammed Yasinhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1195455982020-07-06T11:40:16Z2020-07-06T11:40:16Z<html><head></head><body>Hi ,<br>You can try below code<br><pre><code>@Override
&nbsp;&nbsp; &nbsp;protected void doProcessAction(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;mvcActionCommand.processAction(dynamicActionRequest, actionResponse);
&nbsp;&nbsp; &nbsp;}</code></pre><pre><code>@Reference(
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;target = "(component.name=com.liferay.login.web.internal.portlet.action.LoginMVCActionCommand)")
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;protected MVCActionCommand mvcActionCommand;</code></pre></body></html>Mohammed Yasin2020-07-06T11:40:16ZUpgrade originalStrutsPortletAction.processAction to MVCCommands codemajdi Achourihttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1195388872020-07-06T11:05:23Z2020-07-06T11:05:23ZHello CommunityI migrated a login-hook to an portletMVC portlet which is responsible for the login processs, <br />I migrated the struts wrappers like <em>LoginAction extends BaseStrutsPortletAction</em> to an <em>MVCCommands LoginMVCActionCommand extends BaseMVCActionCommand</em>.<br />So inside the <em>class LoginAction extends BaseStrutsPortletAction <br /></em>inside the <em>processAction(StrutsPortletAction originalStrutsPortletAction, PortletConfig portletConfig, ActionRequest actionRequest, ActionResponse actionResponse) </em>method I found : <em></em><br /><br />if (LoginUtil.isAdmin(login, themeDisplay)) {<br /> <em><strong> originalStrutsPortletAction.processAction(originalStrutsPortletAction, portletConfig, actionRequest, actionResponse);</strong></em><br /> return;<br /> }<br />My question is which code can replace this old struts code : <em><strong>originalStrutsPortletAction.processAction(originalStrutsPortletAction, portletConfig,<br /> actionRequest, actionResponse); </strong>&