掲示板

struts-action path is not working in liferay hook 6.1

7年前 に Kiran Kumar Boyini によって更新されました。

struts-action path is not working in liferay hook 6.1

Expert 投稿: 287 参加年月日: 11/06/02 最新の投稿
Hi All,

I am trying to user struts-action tag in liferay hook for the announcment portlet.
For this I am using hook in my application.
Please see the code below.
liferay-hook.xml :
<struts-action>
		<struts-action-path>/announcements/edit_entry</struts-action-path>
		<struts-action-impl> com.unisys.vantagepoint.struts.action.AnnouncementEditEntryAction</struts-action-impl>
	</struts-action>

jsp :
function <portlet:namespace />saveEntry() {
document.<portlet:namespace />fm.action = '<portlet:actionurl><portlet:param name="struts_action" value="/announcements/edit_entry" /></portlet:actionurl>';
document.<portlet:namespace />fm.target = '';
document.<portlet:namespace />fm.<portlet:namespace />&lt;%= Constants.CMD %&gt;.value = "&lt;%= (entry == null) ? Constants.ADD : Constants.UPDATE %&gt;";
document.<portlet:namespace />fm.<portlet:namespace />content.value = <portlet:namespace />getContent();
submitForm(document.<portlet:namespace />fm);
}

Java class :

public class AnnouncementEditEntryAction extends PortletAction  {
public void processAction(ActionMapping mapping, ActionForm form, PortletConfig portletConfig,ActionRequest actionRequest, ActionResponse actionResponse)
	 		throws Exception {
}
}


after deploy the hook , request is not coming to this java class.i.e., it has to execute process action as per the configuration.

Please let me know anything wrong from my side.

Regards,
Kiran.
thumbnail
7年前 に Amos Fong によって更新されました。

RE: struts-action path is not working in liferay hook 6.1

Liferay Legend 投稿: 2047 参加年月日: 08/10/07 最新の投稿
Hi Kiran,

Take a look at #4 on this doc:
https://dev.liferay.com/develop/tutorials/-/knowledge_base/6-1/overriding-and-adding-struts-actions

Make sure your class extends the right class:
public class ExampleStrutsPortletAction extends BaseStrutsPortletAction {