Hi,
I am unable to get SlingScriptHelper in servlet using the below code..
bundleContext = FrameworkUtil.getBundle(SlingScriptHelper.class).getBundleContext();
factoryRef = bundleContext.getServiceReference(SlingScriptHelper.class.getName());
sling= (SlingScriptHelper) bundleContext.getService(factoryRef);
and
SlingBindings bindings = (SlingBindings) req.getAttribute(SlingBindings.class.getName());
SlingScriptHelper scriptHelper = bindings.getSling();
I am getting null.
java.lang.NullPointerException: Specified service reference cannot be null.
Please help me..
Thanks & Regards,
Veeru
Solved! Go to Solution.
Views
Replies
Total Likes
You can invoke a Sling Servlet from within AEM. See:
http://scottsdigitalcommunity.blogspot.com/2015/02/invoking-aem-sling-servlets-using.html
Views
Replies
Total Likes
What you trying to do - are you trying to get a reference to the Sling Servlet from Java code?
Views
Replies
Total Likes
You can invoke a Sling Servlet from within AEM. See:
http://scottsdigitalcommunity.blogspot.com/2015/02/invoking-aem-sling-servlets-using.html
Views
Replies
Total Likes
Just use indeed @Reference in your servlet...
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies