Thanks.
I would like to add more detail and hopefully I can get an answer for that.
I have a path pointing to a node which has the sling:resourceType is myList component. I wrote MyList.java
using @Model(adaptables = SlingHttpServletRequest.class, adapters = MyList.class,resourceType = MyListImpl.RESOURCE_TYPE).
Is there a way I can adaptTo(MyList.class) and get myList object.
If MyList.java implements using @Model(adaptables=Resource), then I can do this
Resource myListResource = resourceResolver.getResource(path);
MyList ml = MyListResource.adaptTo(MyList.class);
Just don't know how to get MyList object when implemented using adaptable is SlingHttpServletRequest.class in Java?
Thanks.