Hi all , I'm new to Servlets .I just studied filtering in Servlets and tried a small program .
Here is the coding
Here is the part of web.xml content for this filter
The problem is Filtering is not working . I find that doFilter method is not invoked at all when I request "FilterDemo" servlet (which is suppose to be invoked ). Please tell me what is the problem in that coding .
Hi thanks for your replies . I tried after put it in to package but still (as previous) filter's init() and destroy() methods alone invoked . Is anything I'm missing in filter mapping ? I'm using tomcat 5.5.x series
I tried after put it in to package but still (as previous) filter's init() and destroy() methods alone invoked .
Why do you think that the doFilter() was not called? What is your output in the browser? Wasn't the servlet (or the next filter in the chain) invoked?
Joined: Apr 15, 2008
After struggling for a day I found out the problem .
The problem is due to "Invoker" Servlet.While practicing small programs normally I take advance of using "Invoker" servlet without explicitly providing servlet mapping for each servlet in web.xml that is the problem.
If I do so doFilter method is not invoked where as the requested servlet works perfectly but if I explicitly provide url-pattern for that servlet(or url-pattern for that filter) doFilter method of that Filter is invoked