【问题标题】:How to add hook into portlet in liferay?如何在liferay的portlet中添加钩子?
【发布时间】:2016-09-08 23:17:04
【问题描述】:

我已经制作了一个 struts 动作挂钩并希望将它添加到 portlet。我尝试了几件事,例如我首先创建了一个 portlet 插件项目,然后尝试通过右键单击 portlet 项目并单击 New->Liferay Hook Configuration 将钩子添加到其中,但是没有 struts 选项动作挂钩。

所以我决定先做钩子。我现在已经准备好使用钩子了,需要将它添加到 portlet。

我怎样才能实现它?有什么方法可以将 struts 动作钩子添加到 portlet 中?

【问题讨论】:

标签: java liferay


【解决方案1】:

您需要为要在其中添加 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

【讨论】:

    猜你喜欢
    • 2014-01-26
    • 2023-03-26
    • 2013-12-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-11-30
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多