Can we have a condition NOT in the url mapping for the servlet filter

Is it possible to have a NOT condition as a value for url-mapping for a servlet filter? Example: I want to filter out all queries that do not contain "." so let's consider that I have a request, for example, www.website.com/pages. It does not contain a "." or ".html", so I want to filter out all such a request.

+3
source share
1 answer

No, It is Immpossible. You can add this condition to your filter and only do it chain.doFilter(req, resp)(i.e. skip the filter).

+7
source

Source: https://habr.com/ru/post/1780991/


All Articles