I am trying to filter some url pattern to caching.
What I have attempted is put some codes into WebSecurityConfigurerAdapter
implementation.
@O
I solved this with Filter
.
Below is part of my implementation of AbstractAnnotationConfigDispatcherServletInitializer
. In onStartup
method override.
FilterRegistration.Dynamic springSecurityFilterChain = servletContext.addFilter("springSecurityFilterChain", new DelegatingFilterProxy());
if(springSecurityFilterChain != null){
springSecurityFilterChain.addMappingForUrlPatterns(EnumSet.of(DispatcherType.REQUEST), true, "/render/*", "/service/*");
// I removed pattern url "/image/*" :)
}
What I have done is remove /image/*
from MappingUrlPatterns.
Thanks for your answers!