Hi all,
I just want to have multiple selectors & multiple Method type in property attribute of @Component OSGI annotations. And here is the change I made. Is it right? will it work ? If not can anyone help me on this like what is expected?
@Component(service = {Servlet.class},
property = {
"sling.servlet.resourceTypes=" + "cq:Page",
"sling.servlet.selectors=" + HardwareConfiguratorJsonServlet.CONFIGURATOR_SELECTOR,
HardwareConfiguratorJsonServlet.ONECLICKBUY_SELECTOR,
HardwareConfiguratorJsonServlet.HARDWARE_SELECTOR,
"sling.servlet.extensions=" + "json",
"sling.servlet.methods=" + "POST",
"sling.servlet.methods=" + "GET"
})
public class HardwareConfiguratorJsonServlet extends AbstractJsonGeneratorServlet {
@SlingServlet(resourceTypes = "cq:Page",
selectors = {HardwareConfiguratorJsonServlet.CONFIGURATOR_SELECTOR,
HardwareConfiguratorJsonServlet.ONECLICKBUY_SELECTOR,
HardwareConfiguratorJsonServlet.HARDWARE_SELECTOR},
extensions = "json", methods = {"POST", "GET"})
public class HardwareConfiguratorJsonServlet extends AbstractJsonGeneratorServlet {
Thanks,
Vijay
Solved! Go to Solution.
Views
Replies
Total Likes
Hi,
You can check Official OSGi Declarative Services Annotations in AEM - Adobe Experience Manager | AEM/CQ | Apache S... and Apache Sling :: Servlets and Scripts
You can try below
sling.servlet.resourceTypes = [ "sling/unused" ] sling.servlet.selectors = [ "img", "tab" ] sling.servlet.extensions = [ "html", "txt", "json" ]
OR
"sling.servlet.selectors=img",
"sling.servlet.selectors=tab",
Thanks
Arun
Views
Replies
Total Likes
Hi,
You can check Official OSGi Declarative Services Annotations in AEM - Adobe Experience Manager | AEM/CQ | Apache S... and Apache Sling :: Servlets and Scripts
You can try below
sling.servlet.resourceTypes = [ "sling/unused" ] sling.servlet.selectors = [ "img", "tab" ] sling.servlet.extensions = [ "html", "txt", "json" ]
OR
"sling.servlet.selectors=img",
"sling.servlet.selectors=tab",
Thanks
Arun
Views
Replies
Total Likes
Great response Arun!
Views
Replies
Total Likes
Views
Likes
Replies