你在正确的轨道上!
首先在您的插件中创建/WEB-INF/liferay-hook.xml
. 写:
<hook>
<portal-properties>portal.properties</portal-properties>
</hook>
接下来,创建/WEB-INF/src/portal.properties
. servlet.service.events.pre
用监听器类定义:
servlet.service.events.pre=com.example.hook.events.ServicePreAction
接下来,创建该类:
package com.example.hook.events;
import com.liferay.portal.kernel.events.Action;
import com.liferay.portal.kernel.events.ActionException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class ServicePreAction extends Action {
@Override
public void run(HttpServletRequest request, HttpServletResponse response)
throws ActionException {
}
}
从那里您可以ThemeDisplay
从请求中获取对象,该对象将包含您需要的所有信息。