i am using custom porltet in my liferay portal 6.i have some global variable that i want to use through out my portlet classes so for that i have written that variable in portlet.xml file as follows..
<init-param>
<name>Host</name>
<value>smtp.mail.yahoo.com</value>
</init-param>
<init-param>
<name>Port</name>
<value>465</value>
</init-param>
function which working perfect in my portlet action class
publicList<String> ReadSmtpDataForMailNotification() {
List<String> ValuesListObj = new ArrayList<String>();
ValuesListObj.add(this.getInitParameter("Host"));
ValuesListObj.add(this.getInitParameter("Port"));
return ValuesListObj;
}
now problem is that when i excute the function withing the portlet action class then its working perfect but when i want to access this variable outside my portlet class..e.g :- in my local service impl class then i cant access that varible and the value come is always null..so please if anyone can suggest me how can i do get the value of initparam in other then portlet class.
@Advaita Gosvami
have written my.custom.host=liferay.css.com in portlet.properties file
and when i try to fetch value with the following
System.out.println("Property value : - " + PropsUtil.get("my.custom.host"));
its giving me null value..