package org.pqh.config; import org.pqh.core.annotation.EnableWebCrawlerConfiguration; import org.springframework.context.annotation.*; import org.springframework.web.servlet.config.annotation.EnableWebMvc; import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; import org.springframework.web.servlet.config.annotation.ViewResolverRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; /** * Created by reborn on 2017/7/28. */ @EnableWebMvc @ComponentScan({"${spring.scan:org.pqh.controller}"}) @EnableAspectJAutoProxy(proxyTargetClass = true) @EnableWebCrawlerConfiguration public class SpringConfig implements WebMvcConfigurer { @Override public void configureViewResolvers(ViewResolverRegistry registry) { registry.jsp("/WEB-INF/jsp/",".jsp"); } @Override public void addResourceHandlers(ResourceHandlerRegistry registry) { String paths[]=new String[]{"dist","js","less","pages","vendor"}; // for(String path:paths){ // registry.addResourceHandler("/"+path+"/**").addResourceLocations("/"+path+"/"); // } } }