You need to add your portlet.properties under resource folder.
portlet.properties
custom.liferay.base.url = "http://liferay-article.blogspot.in/"
To read it in your java class
You need to import
import com.liferay.portal.kernel.configuration.Configuration;
import com.liferay.portal.kernel.configuration.ConfigurationFactoryUtil;
and use below code to read from properties file
Configuration configuration = ConfigurationFactoryUtil.getConfiguration(PortalClassLoaderUtil.getClassLoader(), "portlet");
System.out.println("liferay custom url->" +configuration.get("custom.liferay.base.url"));
Great !!, Thank you so much, I thought this was impossible, because there is only information about the properties file for the portal, and not at portlet level.
ReplyDeleteNow, would it be possible to do it but with a yaml file?
While assessing the property is practically similar to having your own due persistence measure in progress. Try not to accept all that you see and unquestionably examine anything of inquiry. sell a property
ReplyDelete