I’d like to know, inside a Filter doFilter method, whenever a request is for a mapped servlet in my web.xml. Is there anyway to do so?
Thanks in advance,
Fernando
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
That can’t be done. Better map the filter on those servlets directly. This can be done by using
<servlet-name>instead of<url-pattern>. It has to be exactly that<servlet-name>which is definied in the<servlet>entries. You can specify multiple if you need.Or when you’re already on Java EE 6 /Servlet 3.0 and are thus likely using
@WebFilteron the class.