我有两个portlet,它们具有以下操作方法
A-Portlet
public void actionMethodA(ActionRequest actionRequest,
ActionResponse actionResponse) throws IOException, PortletException {
System.out.println("Portlet A");
}
B-Portlet
public void actionMethodB(ActionRequest actionRequest,
ActionResponse actionResponse) throws IOException, PortletException {
System.out.println("Portlet B");
}我们可以在B-Portlet中调用actionMethodB吗?
发布于 2014-09-12 20:44:06
使用PortletClassInvoker类从另一个插件调用插件方法。
示例:
try {
methodKey = new MethodKey(
ClassResolverUtil.resolveByPortletClassLoader(
"com.acme.SyncFactoryRegistry",
"custom-portlet"), "register", String.class,
Object.class);
}
catch (RuntimeException re) {
return;
}
PortletClassInvoker.invoke(
false, "1_WAR_customportlet",
_methodKey , arg1, arg2);https://stackoverflow.com/questions/25805897
复制相似问题