Hey there ,
I'm trying to registering a custom search servlet by using sling resource type. Deployment of bundle and registering of service is fine as I can view them in felix console .
My servlet is annotated as follows
case 1 : @org.apache.felix.scr.annotations.Component(metatype = false) @Service(Servlet.class) @Properties({ @Property(name = "sling.servlet.extensions", value = "html"), @Property(name = "sling.servlet.selectors", value = "jsonsearch"), @Property(name = "sling.servlet.resourceTypes", value = "geometrixx/components/homepage"), @Property(name = "sling.servlet.methods", value = "GET") }) public class SearchJsonServlet extends SlingSafeMethodsServlet {
The problem is that this service is not getting registered for the specified resource type , From the resource Servlet resolver in felix console , I can see that DefaultGetServlet is getting picked up . If in the browser I try to open the page http://localhost:4502/content/geometrixx/en.jsonsearch.html default getservlet is getting picked up instead of the custom search servlet .( To confirm the page is backed with resource type 'geometrixx/components/homepage' . )
I got my custom servlet to be picked up by updating the annotations to below , but this would change the global behaviour which I want to avoid ,
case 2 :
@org.apache.felix.scr.annotations.Component(metatype = false)
@Service(Servlet.class)
@Properties({
@Property(name = "sling.servlet.extensions", value = "html"),
@Property(name = "sling.servlet.selectors", value = "jsonsearch"),
@Property(name = "sling.servlet.resourceTypes", value = "sling/servlet/default"),
@Property(name = "sling.servlet.methods", value = "GET")
})
Could any one provide me with some pointers to get it done in the right way ?
Thanks in advance
'
The block I'm getting is ,