This commit is contained in:
Parpaillax
2024-05-03 13:51:05 +02:00
parent 173e051af4
commit 68894784f2

View File

@@ -4,6 +4,7 @@ import fr.eni.enchere.interceptor.UserInterceptor;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@@ -26,4 +27,10 @@ public class MvcConfig implements WebMvcConfigurer {
registry.addInterceptor(userInterceptor); registry.addInterceptor(userInterceptor);
} }
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/images/**")
.addResourceLocations("classpath:/static/images/");
}
} }