Hi Manikanta,
We are using sling models in that article and please make note the purpose of Sling models is to define the model object i.e., java object and map that object to Sling resources.
package SlingModel63.core;
import javax.inject.Inject;
import org.apache.sling.api.resource.Resource;
import org.apache.sling.models.annotations.Model;
@Model(adaptables = Resource.class)
public class UserInfo {
@Inject
private String firstName;
@Inject
private String lastName;
@Inject
private String technology;
public String getFirstName() {
return firstName;
}
public String getLastName() {
return lastName;
}
public String getTechnology() {
return technology;
}
}
In above code you are defining the java objects and map that into sling resources of that slingmodel node as in the screenshot.
Its just a node you can create and get that node using resource object and map that objects to sling resources.
Resource resource = resolver.getResource("/content/testsling/slingmodel");
Hence node called testsling/slingmodel is only dummy node we created to store the data for our reference and its not related to Sling models.
Hope this helps!!
Thanks,
Ratna Kumar.