I need to get a SlingScriptHelper instance from within my servlet. Either a ComponentContext or BundleContext will do as well, as my only goal is to get sling services using it.
- Using SCR @Reference injection is not a solution for me, because I will determine at runtime what service class I need to get.
- I've seen posts online that use an activate() method to get ComponentContext, and also decompiled some class that do it, but don't know how to cause sling to call this method and set my ComponentContext
- I've tried pulling it from the Request scope as an attribute, but sling apparently only puts it there for scripts, not servlets.
- I've tried injecting all of these objects themselves - none can be injected.
Any help? I'm hoping there's some static factory I can just hit and get one of these objects so that I can get services...