Hi All,
Doubt as below :
I have an interface where couple of methods are defined. In my component Java class[which is not a service class], if I have to refer any of the method present in the interface, it is not possible.
- Is my Understanding correct?
- Any way we can access methods declared in the interface, via my Component java class?
Any thoughts/pointers on this will be helpful.
Solved! Go to Solution.
Views
Replies
Total Likes
Yes. Your understanding is correct.
POJO class can't refer to methods which are in service. There are multiple ways to pass service to your component class. Sling models do provide a way to inject services directly to the component class. You can try that.
https://helpx.adobe.com/experience-manager/using/sling_models.html
Let me know if you are not willing to use SlingModesl. There are other ways as well.
--
Jitendra
Views
Replies
Total Likes
Yes. Your understanding is correct.
POJO class can't refer to methods which are in service. There are multiple ways to pass service to your component class. Sling models do provide a way to inject services directly to the component class. You can try that.
https://helpx.adobe.com/experience-manager/using/sling_models.html
Let me know if you are not willing to use SlingModesl. There are other ways as well.
--
Jitendra
Views
Replies
Total Likes
Hi Jitendra,
Thank you for your reply. Used getSlingscriptheler.getservice() and it worked.
Views
Replies
Total Likes