Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: read values from portlet.properties file
Hi
I was able to read values from portlet.properties file defined in
custom portlet by using the code
Configuration configuration =
ConfigurationFactoryUtil.getConfiguration(PortalClassLoaderUtil.getClassLoader(),
"portlet");
System.out.println("value is"+configuration.get("xxxx"));
where xxxx is varaiable deined in portlet.properties file.
This code is working until 7.4 ga54. But from 7.4 ga55 configuration intialization is giving a null pointer exception and i am not able to read values from portlet.propeties file. Is this a bug or is there any other way to read values from portlet.properties file?
You can use com.liferay.portal.kernel.util.PropsUtil's get Property("name.of.the.property") method (extra space as we're currently fixing the over-eager firewall blocking some content)