Hi All
I'm new to this Sling Servlets, trying to registering a servlet by path, as well as registering a Servlet by Resource Type that is fine.. when we go for Path and When we go for a Resource Type. give me a explanation here
Views
Replies
Total Likes
By default you should register Servlets via Resource Types. I don't know reasons to bypass this rule.
Jörg
Views
Replies
Total Likes
Binding servlets by paths has several disadvantages when compared to binding by resource types, namely:
Given these drawbacks it is strongly recommended to bind servlets to resource types rather than paths.
Binding by path is useful when you want a non-resource to post data to it. For example, a Java client app that posts data to an AEM Sling Servlet. Say the path is /bin/upfile.
String aemPostUrl = host+"/bin/upfile";
The above string would represent the URL to post to.
Here are the supported ways to register a servelt.
Apache Sling :: Servlets and Scripts
As you can see - both Resource types and Paths are supported.
Views
Replies
Total Likes
Sorry Scott,
but even in this case it makes sense to bind the servlet to a resource instead of a path. Because as already stated by cquser1 you can apply ACLs on that; that means that you control if a certain user has the ability to post at all for free (that means with no coding) and configurable during runtime. You need a lot of coding if you want to implement this logic in your servlet :-)
Jörg
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies