2 SlingHttpServletRequests walk up to a WhiteBoard...

2 SlingHttpServletRequests walk up to a WhiteBoard...

Recently while creating a Servlet - which I have done hundreds of times on many a CQ based projects - the Default Get Servlet was getting resolved for my request.  I added logging, made sure the SCR name property was populated, round and round I go...  Unlike Stewart the GEICO mascot, I was not yelling "Weee!"  Quite the opposite.

After bugging my compadre to have an extra set of eyes on the problem, and check to see if I was missing anything, a deep dark lurking memory started to surface.  Viola - I forgot there is a new CQ feature where you  "register" your servlet paths in CQ.  I am not talking about "allow" and "deny" statements in the Dispatcher - that is something completely different.  This is a new feature in CQ 5.5.

Go to the Felix Console and search for "Apache Sling Servlet / Script Resolver and Error Handler".  In this little hidden mustard seed are the keys to the Servlet kingdom.  Add your new Servlet path here, and CQ will now resolve requests for your Servlet path to your new JavaEE Servlet.

Enjoy.

Share this post

0 Comments

comments powered by Disqus