我已经制作了一个struts动作钩子并希望将它添加到portlet中。我尝试了几件事,比如我首先制作一个portlet插件项目,然后尝试通过右键单击portlet项目并单击 New-> Liferay Hook配置来添加钩子,但是没有选项struts动作挂钩那里。
所以我决定先挂钩。我现在准备好了钩子,需要将它添加到portlet。
我怎样才能实现它?有没有办法向portlet添加struts动作钩子?
答案 0 :(得分:0)
您需要为要添加struts操作的portlet的struts路径添加前缀。您可以在/ROOT/WEB-INF/liferay-portlet.xml中找到Liferay OOTB portlet的struts路径。
示例:
考虑您要将新的struts操作添加到留言板portlet。你必须在liferay-hook.xml中编写struts-action-path
,如下所示:
<struts-action-path>/message_boards/new_struts_action</struts-action-path>
HTH