JakartaJEEWebDevelopment

Jakarta JEE8 Enterprise Web Development

View on GitHub

4. Exploring Filter Order with a Simple Example

Have a look at the following Servlet code:

ServletOne.java

ServletTwo.java

ServletThree.java

Filter code as well:

FilterA.java

FilterB.java

FilterC.java

We see how the filters are mapped in the deployment descriptor here:

web.xml

We will now compile and run this web app example:

Go to:

http://localhost:8080/charity-registration/ServletOne

http://localhost:8080/charity-registration/ServletTwo ?

http://localhost:8080/charity-registration/ServletThree ?

Play around with the order to find out how it works