Hi h_kataria I tryed with diferents values of service ranking and with the following definition
property = {
Constants.SERVICE_RANKING + ":Integer=" + Integer.MAX_VALUE,
Constants.SERVICE_DESCRIPTION + "= Redirect page request to target locations",
"sling.servlet.extensions=" + "html",
"sling.servlet.selectors=" + "redirect",
"sling.servlet.resourceTypes=" + "cq/Page",
"sling.servlets.methods=" + "GET"
}, and its didnt work. can you share with me an example?
Thanks
There is a typo in your servlet registration. Use
sling.servlet.methods
instead of
sling.servlets.methods
I tried
@8220494(service = Servlet.class,
property = {
Constants.SERVICE_DESCRIPTION + "= Redirection Servlet",
"sling.servlet.extensions=" + "html",
"sling.servlet.selectors=" + "redirect",
"sling.servlet.resourceTypes=" + "cq/Page",
"sling.servlet.methods=" +"GET",
Constants.SERVICE_RANKING + ":Integer=" + Integer.MAX_VALUE
})And this worked fine. So, just fix the typo and I think it should work.