Sling Scripts cannot be called directly in CQ5.
Hi All,
I read the below :
Within Sling, scripts cannot be called directly as this would break the strict concept of a REST server; you would mix resources and representations.
If you call the representation (the script) directly you hide the resource inside your script, so the framework (Sling) no longer knows about it. Thus you lose certain features:
automatic handling of http methods other than GET, including:
POST, PUT, DELETE which are handled with a sling default implementation
the POST.jsp script in your sling:resourceType location
your code architecture is no longer as clean nor as clearly structured as it should be; of prime importance for large-scale development
I could not understand much on this. Any detailed explanation on this will be helpful.