掲示板

Liferay DXP portlet.properties

thumbnail
7年前 に Ravi Darji によって更新されました。

Liferay DXP portlet.properties

Junior Member 投稿: 56 参加年月日: 14/05/14 最新の投稿
Hi Everyone,

As we are using PortletProps.get("property.name") in liferay 6.2 to get property value from portlet's portlet.properties file,

Is someone knows that how can i do same in liferay DXP?

Thanks & Regards,
Ravi Darji
thumbnail
7年前 に David H Nebinger によって更新されました。

RE: Liferay DXP portlet.properties

Liferay Legend 投稿: 14919 参加年月日: 06/09/02 最新の投稿
It is available for portlet wars, but for OSGi you should be switching over to Configuration Admin (OSGi). There's doco in dev.liferay.com for this and examples in the Liferay source.
thumbnail
6年前 に Scott Lee によって更新されました。

RE: Liferay DXP portlet.properties

Junior Member 投稿: 55 参加年月日: 06/09/26 最新の投稿
thumbnail
6年前 に Liferay Dev によって更新されました。

RE: Liferay DXP portlet.properties

Junior Member 投稿: 81 参加年月日: 15/05/17 最新の投稿
Use this piece of code to read portlet.properties
Configuration configuration = ConfigurationFactoryUtil.getConfiguration(PortalClassLoaderUtil.getClassLoader(), "portlet");
thumbnail
6年前 に David H Nebinger によって更新されました。

RE: Liferay DXP portlet.properties

Liferay Legend 投稿: 14919 参加年月日: 06/09/02 最新の投稿
Liferay Dev:
Use this piece of code to read portlet.properties
Configuration configuration = ConfigurationFactoryUtil.getConfiguration(PortalClassLoaderUtil.getClassLoader(), "portlet");


What? This is totally confusing. You're going to use the portal class loader, the one where none of your code is actually running? And what is "portlet"? Did you mean for this to be a placeholder for a portlet name or id or service or what?

Answering forum questions is always welcome, but keep in mind that there are people reading these posts with different levels of experience and often you need to provide some contextual details. A newbie trying this code is going to be completely stymied trying to understand why it is not working or trying to adapt it to their project.








Come meet me at Devcon 2017 or 2017 LSNA!
thumbnail
6年前 に Liferay Dev によって更新されました。

RE: Liferay DXP portlet.properties

Junior Member 投稿: 81 参加年月日: 15/05/17 最新の投稿
Use this piece of code to read portlet.properties
Configuration configuration = ConfigurationFactoryUtil.getConfiguration( get Portlet level class loader , "portlet");