Performing Sling Model Adaptation Using Request and Resource Objects
There are use cases where you may need to get a Request object inside a Sling Model or you want to adapt your Sling Model using a SlingHttpServletRequest object (where you don’t want to create a resource object). In this situation, you do not need to create two different Sling Models. In this development article, you learn how to write your Sling Model, make it adaptable by using either a SlingHttpServletRequest or Resource (or both the objects), and inject Resource properties at the same time.
To become an Experience Business, you need more than just great tools and online help. You need a partner. Experience League is a new enablement program with guided learning to help you get the most out of Adobe Experience Cloud. With training materials, one-to-one expert support, and a thriving community of fellow professionals, Experience League is a comprehensive program designed to help you become your best.
Join the Adobe Experience League by clicking this banner.