I have created a filter for “/folder/*” using the JaveEE 6 Annotation
@WebFilter("/folder/*")
However when I go to “/test.html” which has a call
request.getRequestDispatcher("/folder/test.jsp").forward(request, response);
in the doGet, the page is not filtered. When going to “/folder/test.jsp” manually in the browser, the filter works fine. How can I make it work when using a dispatcher also?
I have found a solution for the xml way of creating filters multiple places such as here or here but have been unable to find a solution using annotations. Thanks!
The annotations seems to have a dispatcherTypes attribute to support this, so the following should work: