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
Why getService() Method ?
Hi ,
I am using this line of code, it's working fine
School list = SchoolLocalServiceUtil.secretPinValidation(secretPin);
if i am using this line of code, it's also working fine
School list = SchoolLocalServiceUtil.getService().secretPinValidation(secretPin);
I want to know what is the difference b/w with getService() method and without getService() method.
Thanks .............
I am using this line of code, it's working fine
School list = SchoolLocalServiceUtil.secretPinValidation(secretPin);
if i am using this line of code, it's also working fine
School list = SchoolLocalServiceUtil.getService().secretPinValidation(secretPin);
I want to know what is the difference b/w with getService() method and without getService() method.
Thanks .............
Hi.
In most cases there is no difference, generated *Util.method() is just shortcut for *Util.getService().method().
I saw some *Utils' methods that don't follow this structure, but all *Util classes that are generated using ServiceBuilder should call spring service in the same (this) way.
In most cases there is no difference, generated *Util.method() is just shortcut for *Util.getService().method().
I saw some *Utils' methods that don't follow this structure, but all *Util classes that are generated using ServiceBuilder should call spring service in the same (this) way.