Java EE 8 : Servlet Mapping Detection

Java EE 8’s Servlet now provides an easy way to detect the URL mapping which invoked the Servlet.
A Servlet can have multiple Servlet Mappings, for example, we can access a Servlet by this mapping “/hi” and this one too “/page.html”. These mappings are usually defined either in the deployment descriptor or via annotations.