Skip to content

Instantly share code, notes, and snippets.

@dhval
Last active May 3, 2024 13:57
Show Gist options
  • Save dhval/8fba7173312f6a6ea7ed to your computer and use it in GitHub Desktop.
Save dhval/8fba7173312f6a6ea7ed to your computer and use it in GitHub Desktop.
Convert Excel to JSON
@Configuration
@EnableWebMvc
@ComponentScan(basePackages = {"com.example"})
public class MapTrucksConfig extends WebMvcConfigurerAdapter {
@Override
public void addViewControllers(ViewControllerRegistry registry) {
registry.addViewController("/").setViewName("index");
}
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/bower_components/**", "/scripts/**", "/styles/**", "/fonts/**")
.addResourceLocations("/dist/bower_components/", "/dist/scripts/", "/dist/styles/", "/dist/bower_components/bootstrap/fonts/**")
.setCachePeriod(315569126);
}
@Override
public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) {
configurer.enable();
}
@Bean
public ViewResolver viewResolver() {
InternalResourceViewResolver viewResolver = new InternalResourceViewResolver();
viewResolver.setPrefix("/dist/");
viewResolver.setSuffix(".html");
viewResolver.setViewClass(InternalResourceView.class);
return viewResolver;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment