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
LR-7 Store value in portal.properties
Hello friends,
I am using Liferay 7.2
I want to store value in portal.properties file.
I have tried with PropsUtil ( both com.liferay.portal.kernal. and com.liferay.portal.util.) , but after restarting the server the key's value getting reset.
Means after server restart it getting null value.
Please help me into it.
Thanks in advance.
I am using Liferay 7.2
I want to store value in portal.properties file.
I have tried with PropsUtil ( both com.liferay.portal.kernal. and com.liferay.portal.util.) , but after restarting the server the key's value getting reset.
Means after server restart it getting null value.
Please help me into it.
Thanks in advance.
I think the accepted practice is to create a portal.properties or portlet.properties file in a custom module. You can write your own class method to get the value.
Hi,
You can also try implementing System Configuration , for saving custom properties.
https://help.liferay.com/hc/en-us/articles/360018161391-Making-Your-Applications-Configurable
You can also try implementing System Configuration , for saving custom properties.
https://help.liferay.com/hc/en-us/articles/360018161391-Making-Your-Applications-Configurable
Hello Mohammad,
Actually, I am trying to make own email template for email send.
Like whatever build in liferay for email sending on account creation, password reset like that.
Instance Setting > Email
Can you please let me know how to get it..
Actually, I am trying to make own email template for email send.
Like whatever build in liferay for email sending on account creation, password reset like that.
Instance Setting > Email
Can you please let me know how to get it..
Do you want to use it in your own application? How do you want to send the email? You have several options.
a) You could indeed add it to portal-ext.properties, but I would not recommend that. It will be messy, since you should just add some short config options there, not whole documents
b) You could use a webcontent article for it. Then you would only need to store the ID of the webcontent somewhere. Editors can then just edit the article and you would only need to read it using the API where you send the email.
c) You could add a configuration. You will only have a text editor there, but it could be sufficient if you don't plan to do something fancy.
https://help.liferay.com/hc/en-us/articles/360018161391-Making-Your-Applications-Configurable
d) You could create your own service to store the email template. This approach is pretty powerful, but if you need it only once or twice, it probably doesn't pay off.
a) You could indeed add it to portal-ext.properties, but I would not recommend that. It will be messy, since you should just add some short config options there, not whole documents
b) You could use a webcontent article for it. Then you would only need to store the ID of the webcontent somewhere. Editors can then just edit the article and you would only need to read it using the API where you send the email.
c) You could add a configuration. You will only have a text editor there, but it could be sufficient if you don't plan to do something fancy.
https://help.liferay.com/hc/en-us/articles/360018161391-Making-Your-Applications-Configurable
d) You could create your own service to store the email template. This approach is pretty powerful, but if you need it only once or twice, it probably doesn't pay off.
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™