Hey guys,
I need to initialize a sling model for component B from inside component A. I have access to a sling Resource object for component B and a SlingHttpServletRequest for component A.
So I can easily do:
ComponentB componentB = resourceForComponentB.adaptTo(ComponentB.class);
But the @PostConstruct initializer for ComponentB uses a SlingHttpServletRequest (up until now, it had only been adapted via request). How do I initialize the @SlingObject request so that the @PostConstruct for ComponentB will be able to execute (without a null pointer exception).
Thanks!