Depending on the path you have chosen for your servlet, you might need to add it into the 'Apache Sling Servlet/Script Resolver and Error Handler' OSGi config, in the Execution Paths section.
Here is an update, I am able to trigger the servlet when I am building the code in CRXDE bundle.
But when I try to create the servlet in a seperate Maven project. I am not able to trigger the servlet.
Is there any configuration that I will need to add in order to register the servlet?
please check in your build:
- the maven scr plugin configuration
- the maven bundle configuration
Those two should do the trick.
Can you please add your servlet code here ?