Hi @shagunmalik ,
Using below code you can access any property and can set in Sling Model Getter, which you can access in HTL-
Map<String, Object> param = new HashMap<>();
param.put(ResourceResolverFactory.SUBSERVICE, "myservice");
try (ResourceResolver resolver = resourceResolverFactory.getServiceResourceResolver(param)) {
Resource res = resolver.getResource("PATH to RESOURCE");
ValueMap pageProperties = resource.getValueMap();
String propertyValue = properties.get("property name", String[].class);
Now, your question about what is subservice-
Just think of subservice as "Level of Access". Means you are trying to get repository access and you define which service I want to use, for example
1. I want to write content to repository, so I need write access so my service name could be writeService (name of service can be anything meaningful)
2. I just want to read some content and no need to write so I can use same writeService (not reccommended) or can create new one with least privileges required.
Now, using Apache Sling User Mapper Service, we just Map this Sub service to system user. system user is actually the one which has read/write access and we use sub service name to map it with system user.
One more thing, there are implicit out of the objects, which you can also use if you want to access the current page properties, you can refer below URL-
https://experienceleague.adobe.com/docs/experience-manager-htl/using/htl/global-objects.html?lang=en