Sling Model with method having @PostConstruct - how to debug
Hi,
1. Can you please recommend the steps to debug the sling model.
2. If I have the method with @PostConstruct, when will it get executed ?
3. If there is a constructor, when will it get executed ?
++++ EXAMPLE ++++
@Model(adaptables=Resource.class)
public class TestModel {
@Inject @Named("path")
private String id;
@Inject @Named("jcr:title")
private String title;
@PostConstruct
protected void init() {
LOG.info("Inside init() ");
}
@Inject
public TestModel(Resource resource) {
final String id = resource.getPath();
}
}