In this post, I’m going to highlight everything new we have in Servlet 4.0, so get ready!
We use filters a lot, whether, for image compression, logging, or authentication, they have been with us since J2EE 1.3, that’s in 2001!
Now before digging into Java EE 8, let’s check how we used to write filters until today.
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.