Does anyone know why a web.xml filter wouldn't be run when serving a welcome file, or any static content? It seems to only run on URLs that are mapped to a servlet. How can I get the filter functionality on static content?
Here's what I'm using:
<filter>
<filter-name>myFilter</filter-name>
<filter-class>com.domain.project.server.service.MyFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>myFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter>
<filter-name>springSecurityFilterChain</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<welcome-file-list>
<welcome-file>WelcomeFile.html</welcome-file>
</welcome-file-list>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…