Skip to content

Instantly share code, notes, and snippets.

@joshlong
Last active December 14, 2015 08:49
Show Gist options
  • Save joshlong/5060815 to your computer and use it in GitHub Desktop.
Save joshlong/5060815 to your computer and use it in GitHub Desktop.
package org.springsource.examples.spring31.web.config;
// ...
@Configuration
@EnableWebMvc
@ComponentScan(basePackageClasses = { ViewController.class, CustomerService.class })
public class WebMvcConfiguration extends WebMvcConfigurerAdapter {
//...
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/web/**").addResourceLocations("/web/");
}
public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) {
configurer.enable();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment