Introduction
Java EE is the abstract specifications for developing enterprise applications. These specifications are implemented by the application server vendors like weblogic, websphere.
For example, JSP and Servlet are speciation for developing web applications. Obviously web applications deployed to the server. So, server vendors has to implement the specification.
Where as spring follows some of the specifications from Java EE and override with better options. It is a standalone framework built on top of the Java EE technology.
Servlet filter
https://www.journaldev.com/1933/java-servlet-filter-example-tutorial