Hello Community - I am getting an error while retrieving the values from Sling Model and using it in JSP. Not sure what is the issue? Can someone help with this?
org.apache.sling.models.impl.ModelAdapterFactory Could not adapt to model org.apache.sling.models.factory.ModelClassException: Unable to find a useable constructor for model class com.test.aem.core.models.TestModel at org.apache.sling.models.impl.ModelAdapterFactory.createObject(ModelAdapterFactory.java:686) [org.apache.sling.models.impl:1.4.12]
Looks like you are trying to inject the SlingHttpServletRequest via Constructor(couldn't find inject annotation though, not sure if its a typo while pasting the code here in the post), Remove the constructor and you can use either @Self or @SlingObject for injecting SlingHttpServletRequest.