【发布时间】:2014-07-11 10:47:25
【问题描述】:
我在 Spring Portlet A 中定义了一个 spring bean。我的问题是如何使用 portlet bean 定位器在另一个 Portlet B 中定位这个 bean。是否可能,因为下面的行对我不起作用。
MyBean myBean = (MyBean)PortletBeanLocatorUtil.locate("PortletA-portlet", MyBean.class.getName());
PS:我在 Portlet A web.xml 中声明了 ContextLoaderListener 并使用 contextConfigLocation 来设置要加载的上下文文件,而这个 bean 是在上下文文件中定义的。
【问题讨论】: