Exclude URL from display filter in web.xml

I am using spring mvc and I need to exclude urls from the filter-match. This means that I have static content such as images and css and js ... and I do not need to process this request, for example, from a security filter. I tried urlrewrite, but I was not able to redirect the urls directly to the defaultServlet, which is defined in the catalina web.xml file. I need to jump over filters, because I have a lot of them. Is there any way? Thanks

EDIT - I thought maybe I could create a filter that would be if I decided to jump over other filters and execute the servlet at the end. Can this be done? Thanks

+5
source share
2 answers

At the end, I used:

<filter>
    <filter-name>UrlRewriteFilter</filter-name>
    <filter-class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</filter-class>
    <init-param>
        <param-name>logLevel</param-name>
        <param-value>Warn</param-value>
    </init-param>
</filter>

and a link to the URL was provided:

<urlrewrite default-match-type="wildcard">
<rule>
    <from>/static/**</from>
    <to>/static/$1</to>
</rule>

+5
source

All Articles