在包含生成友好 URL 的函数后,我的 Liferay-Portal 出现问题。这是功能:
#set ($layoutLocalService = $serviceLocator.findService("com.liferay.portal.service.LayoutLocalService"))
#set ($layoutId = $getterUtil.getLong($image-link.getData()))
#set ($themeDisplay = $request.get('theme-display'))
#set ($currentPlid = $getterUtil.getLong($themeDisplay.get('plid')))
#set ($currentLayout = $layoutLocalService.getLayout($currentPlid))
#set ($layout = $layoutLocalService.getLayout($getterUtil.getLong($groupId), $currentLayout.isPrivateLayout(), $layoutId))
#set( $friendlyUrl = $layout.getFriendlyURL().replace("/", "") )
成功部署后,在浏览网站时,我的控制台输出以下内容:
09:15:26,279 ERROR [http-bio-8080-exec-83][LiferayMethodExceptionEventHandler:33] com.liferay.portal.NoSuchLayoutException: No Layout exists with the primary key 0
com.liferay.portal.NoSuchLayoutException: No Layout exists with the primary key 0
如何获取当前页面的 layoutID 而不是该图像链接的 layoutID?