OSGI R6 servlet paths list property
I am trying to use multiple paths in servlet. I am able to achieve this using below syntax:
@Component(service=Servlet.class,
name="Sample Servlet",
property={
"sling.servlet.methods=" + HttpConstants.METHOD_POST,
"sling.servlet.paths="+ "/bin/path1",
"sling.servlet.paths="+ "/bin/path2"
})
Is there a way to improve above annotation so that I don't have to define paths multiple time.Instead I should be able to set it as a list or with REGEX pattern?
I tried below syntax but seems it is not working:
@Component(service=Servlet.class,
name="Sample Servlet",
property={
"sling.servlet.methods=" + HttpConstants.METHOD_POST,
"sling.servlet.paths="+ "/bin/path*"
})
@Component(service=Servlet.class,
name="Sample Servlet",
property={
"sling.servlet.methods=" + HttpConstants.METHOD_POST,
"sling.servlet.paths="+ "[/bin/path1,/bin/path2]"
})
Please share the various options for above.
Thanks,
Rajeev
