URLs

Necessary utility classes:

com.liferay.portal.util.PortalUtil
Get your portal URL programmatically:
public String getPortalUrl() 
throws PortalException, SystemException {
Company defaultCompany = 
CompanyLocalServiceUtil.getCompany(PortalUtil.getDefaultCompanyId());
portalUrl = 
defaultCompany.getPortalURL(defaultCompany.getGroupId());
   
return portalUrl;
}

Leave a Reply