How to get friendly URL in Liferay DXP ?

Vishnu S Kumar, modified 7 Years ago. Regular Member Posts: 131 Join Date: 7/28/17 Recent Posts
We have the "com.liferay.portal.kernel.model.Layout" Object.  Using this object we need to find its friendly URL. The PortalUtil.getLayoutFriendlyURL() needs the 'ThemeDisplay' object and we can't create that object. The PortalUtil.getLayoutActualURL() gives something like this "localhost:8080/c/portal/layout?p_l_id=923&p_v_l_s_g_id=45" etc. But we need to get the friendly URL to the page (layout) like "localhost:8080/web/guest/for-business/technology" .


How to create the Friendly URL without ThemeDisplay Object provided the Layout Object ?