Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.0.0, 3.0.1
-
None
Description
As shown in the following code fragment, portlet-skin.jsp uses the <pluto:title/> JSP tag in order to render the title of each portlet on the portal page:
<!-- Use pluto portlet tag to render the portlet --> <pluto:portlet portletId="${portlet}"> <!-- Assemble the rendering result --> <div class="portlet"> <table class="header" width="100%"> <tr> <td class="header" align="left"> <!-- Portlet Title --> <h2 class="title"><pluto:title/></h2> </td> ... </tr> ... <table> ... </pluto:portlet>
This in turn invokes PortletTitleTag.doStartTag() which does the following:
...
PortletConfig config = driverConfig.getPortletConfig(portletId);
...
Locale defaultLocale = request.getLocale();
ResourceBundle bundle = config.getResourceBundle(defaultLocale);
title = bundle.getString("javax.portlet.title");
The call to config.getResourceBundle(defaultLocale) eventually calls DriverPortletConfigImpl.getResourceBundle(Locale) which in turn calls ResourceBundleFactory.getResourceBundle(Locale).
The ResourceBundleFactory.getResourceBundle(Locale) method uses the TCCL in order to load the resource bundle resource:
ClassLoader loader = Thread.currentThread().getContextClassLoader(); bundle = ResourceBundle.getBundle(bundleName, locale, loader);
The problem is that the ClassLoader associated with portlet-skin is the one for the "/pluto" webapp context, not the one for the portlet. This causes the resource bundle lookup to fail, which in turn causes the resource bundle cache to contain a bundle that has no property values.
One possible fix for this problem would be to ensure that the portlet itself obtains the resource bundle before pluto-skin.jsp tries to do it.