Quantcast
Channel: Active questions tagged servlets - Stack Overflow
Viewing all articles
Browse latest Browse all 714

Java Servlet Filter Capture Root Path [duplicate]

$
0
0

I am creating a small servlet project to mock an authentication flow. I am performing authentication with a servlet filter sitting in front of a few JSP pages.

To map the urlPatterns captured by the filter, I am using a WebFilter annotation specified as follows:

@WebFilter({"","/gallery.jsp","/welcome.jsp"})

From my understanding, the empty string should catch the root path.

So when I enter localhost:8080/auth-jsp-demo/ into my browser the filter should catch. However, my logs are showing that the filter is not catching the root path.

I am using Tomcat v9 and JDK 11.


Viewing all articles
Browse latest Browse all 714

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>