SpringBoot-Web开发
要解决的问题:
1)导入静态资源
2)首页定制
3)jsp,模板引擎 Thymeleaf
4)装配扩展SpringMVC
5) 增删改查
6) 国际化
7) 拦截器
静态资源导入
在类public static class WebMvcAutoConfigurationAdapter implements WebMvcConfigurer
中
public void addResourceHandlers(ResourceHandlerRegistry registry) {
if (!this.resourceProperties.isAddMappings()) {
logger.debug("Default resource handling disabled");
} else {
Duration cachePeriod = this.resourceProperties.getCache().getPeriod();
CacheControl cacheControl = this.resourceProperties.getCache().getCachecontrol().toHttpCacheControl();
if (!registry.hasMappingForPattern("/webjars/**")) {
this.customizeResourceHandlerRegistration(registry.addResourceHandler(new String[]{
"/webjars/**"}).addResourceLocations(new String[]{
"classpath:/META-INF/resources/webjars/"}).setCachePeriod(this.getSeconds(cachePeriod)).setCacheControl(cache