7 Replies Latest reply on Jul 17, 2017 6:36 AM by cquser1

    Not able to make use of SlingHttpServletRequest in Sling Model in AEM 6.3

    cquser1 Level 2

      Hi,

       

      Currently have a model class with @Model(adaptables = Resource.class). The code written so far works absolutely fine.

       

      To this , I have now added the below

       

      @Model(adaptables = { Resource.class, SlingHttpServletRequest.class })

       

         @Inject

          SlingHttpServletRequest request;

       

      as I want to make use of request Object in my code.

       

      Referred multiple links on this, Few examples :

       

      https://www.slideshare.net/AEMHub2014/sling-models-by-justin-edelson-final

      http://www.wemblog.com/2014/11/how-to-use-sling-models-in-cq56.html

      https://forums.adobe.com/thread/2329143

       

      But still not working. " Identifier xysdkfjk cannot be correctly instantiated by the Use API" is the error I keep getting.

       

      Any thoughts on this will be helpful.