public class Vfs2ResourceHandlerRegistry extends Object
Wrap the Spring MVC ResourceHandlerRegistry class in order to register a
Vfs2ResourceHttpRequestHandler.
Without this hack, you will have this kind of error: java.lang.ClassNotFoundException:
org.jboss.vfs.VFS from BaseClassLoader.
This class shoud be used from the
WebMvcConfigurer.addResourceHandlers(ResourceHandlerRegistry) method:
new Vfs2ResourceHandlerRegistry(registry, applicationContext).addResourceHandler("/resources/webjars/**").addResourceLocations(
"classpath:/META-INF/resources/webjars/");
The applicationContext parameter could be inject into the Configuration class:
| Modifier and Type | Method and Description |
|---|---|
org.springframework.web.servlet.config.annotation.ResourceHandlerRegistration |
addResourceHandler(String... pathPatterns) |
public org.springframework.web.servlet.config.annotation.ResourceHandlerRegistration addResourceHandler(String... pathPatterns)
Copyright © 2014-2015. All Rights Reserved.