I am using spring mvc and I need to exclude urls from filter-mapping. It means, I have static content like pictures and css and js ... and I need to not process these request, for example from security filter. I tried urlrewrite, but I was not able to redirect the urls directly to defaultServlet, which is defined in catalina web.xml. I need to jump over filters, because I have a lot of them. Is there a way? Thanks
EDIT - I thought maybe I could create filter which will if decided jump 开发者_运维问答over other filters and execute the servlet at the end. Is it possible to do that? Thanks
In 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 url rewrite was defined:
<urlrewrite default-match-type="wildcard">
<rule>
<from>/static/**</from>
<to>/static/$1</to>
</rule>
Some example solution:
http://java-espresso.blogspot.com/2011/09/webxml-problem-and-solution-for-url.html
another one:
http://www.xinotes.org/notes/note/1024/
and another one:
http://blog.ericdaugherty.com/2010/02/excluding-content-from-url-pattern-in.html
Hope that helps...
Konrad
精彩评论