Hi all,
I have a problem with a filter deployment. I have a very simple filter that just outputs a message to the console via a System.out.println call.
To test the filter, I created a simple Servlet named TestServlet which actually does nothing in its doGet. TestServlet has been deployed on servlet path /TestServlet under the webcontent (MyProject)
I confirm that I can call the servlet via
http://localhost:8080/MyProject/TestServlet without any problems.
My problem is, when I specify the servlet name in WebFilter annotation, tomcat seems to ignore it. (ServletFilter is not triggered.)
@WebFilter(servletNames = { "TestServlet" })
public class TestFiltre implements Filter {}
But when I use urlPatterns attribute, The filter works fine.
@WebFilter(urlPatterns = { "/TestServlet" })
Does Tomcat support servletNames in Filters? Or I have a configuration problem?
Thanks a lot,
Murat