0

我正在运行 Liferay 6.2 GA2。使用以下源创建了具有虚拟结构和模板的 Web 内容。

#set($layoutServiceUtil = $serviceLocator.findService("com.liferay.portal.service.LayoutService"))
#set($topPublicLayouts = $layoutServiceUtil.getLayouts($groupId,true))
#set($viewCountExpName = 'viewCount')
#set($viewCount = ${topPublicLayouts.get(0).getExpandoBridge().getAttribute($viewCountExpName)})
Works in Chrome-${topPublicLayouts.get(0).getExpandoBridge().getAttribute($viewCountExpName)}-
-${topPublicLayouts.get(0).getNameCurrentValue()}-
--${viewCount}--

创建了自定义属性,从 portal-ext.properties 中删除了速度限制。

上面的代码在 Chrome 中有效,但在 IE 中无效。

铬响应:

适用于 Chrome-1617- -Home- --1617--

IE 中的响应(8、9、10 和 11):

适用于 Chrome-${topPublicLayouts.get(0).getExpandoBridge().getAttribute($viewCountExpName)}- -Home- --${viewCount}--

Velocity 包上的调试为我提供了以下仅适用于 IE 的错误日志:

17:41:45,687 DEBUG [RuntimePageImpl-6][velocity:155] Null reference [template '10257#10297#12641', line 5, column 17] : ${topPublicLayouts.get(0).getExpandoBridge().getAttribute($viewCountExpName)} cannot be resolved.
17:41:45,688 DEBUG [RuntimePageImpl-6][velocity:155] Null reference [template '10257#10297#12641', line 7, column 3] : ${viewCount} cannot be resolved.

如何获得$viewCount在 IE 浏览器中工作的价值。

4

0 回答 0