[BAEL-15393] - Update Spring File Upload article
This commit is contained in:
@@ -23,15 +23,15 @@ public class LoggingAspect {
|
||||
}
|
||||
};
|
||||
|
||||
@Pointcut("@target(org.springframework.stereotype.Repository)")
|
||||
@Pointcut("within(com.baeldung..*) && execution(* com.baeldung.dao.FooDao.*(..))")
|
||||
public void repositoryMethods() {
|
||||
}
|
||||
|
||||
@Pointcut("@annotation(com.baeldung.aop.annotations.Loggable)")
|
||||
@Pointcut("within(com.baeldung..*) && @annotation(com.baeldung.aop.annotations.Loggable)")
|
||||
public void loggableMethods() {
|
||||
}
|
||||
|
||||
@Pointcut("@args(com.baeldung.aop.annotations.Entity)")
|
||||
@Pointcut("within(com.baeldung..*) && @args(com.baeldung.aop.annotations.Entity)")
|
||||
public void methodsAcceptingEntities() {
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ public class PerformanceAspect {
|
||||
|
||||
private static Logger logger = Logger.getLogger(PerformanceAspect.class.getName());
|
||||
|
||||
@Pointcut("within(@org.springframework.stereotype.Repository *)")
|
||||
@Pointcut("within(com.baeldung..*) && execution(* com.baeldung.dao.FooDao.*(..))")
|
||||
public void repositoryClassMethods() {
|
||||
}
|
||||
|
||||
|
||||
@@ -20,11 +20,11 @@ public class PublishingAspect {
|
||||
this.eventPublisher = eventPublisher;
|
||||
}
|
||||
|
||||
@Pointcut("@target(org.springframework.stereotype.Repository)")
|
||||
@Pointcut("within(com.baeldung..*) && execution(* com.baeldung.dao.FooDao.*(..))")
|
||||
public void repositoryMethods() {
|
||||
}
|
||||
|
||||
@Pointcut("execution(* *..create*(Long,..))")
|
||||
@Pointcut("within(com.baeldung..*) && execution(* com.baeldung.dao.FooDao.create*(Long,..))")
|
||||
public void firstLongParamMethods() {
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@ import org.springframework.context.support.ResourceBundleMessageSource;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.converter.ByteArrayHttpMessageConverter;
|
||||
import org.springframework.http.converter.HttpMessageConverter;
|
||||
import org.springframework.web.multipart.commons.CommonsMultipartResolver;
|
||||
import org.springframework.web.servlet.ViewResolver;
|
||||
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
|
||||
import org.springframework.web.servlet.config.annotation.PathMatchConfigurer;
|
||||
@@ -63,7 +62,7 @@ public class WebConfig implements WebMvcConfigurer {
|
||||
final SpringResourceTemplateResolver templateResolver = new SpringResourceTemplateResolver();
|
||||
templateResolver.setPrefix("/WEB-INF/templates/");
|
||||
templateResolver.setSuffix(".html");
|
||||
templateResolver.setTemplateMode("HTML5");
|
||||
templateResolver.setTemplateMode("HTML");
|
||||
return templateResolver;
|
||||
}
|
||||
|
||||
@@ -87,15 +86,6 @@ public class WebConfig implements WebMvcConfigurer {
|
||||
public void addResourceHandlers(final ResourceHandlerRegistry registry) {
|
||||
registry.addResourceHandler("/resources/**").addResourceLocations("/resources/");
|
||||
}
|
||||
|
||||
@Bean(name = "multipartResolver")
|
||||
public CommonsMultipartResolver multipartResolver() {
|
||||
|
||||
final CommonsMultipartResolver multipartResolver = new CommonsMultipartResolver();
|
||||
multipartResolver.setMaxUploadSize(100000);
|
||||
|
||||
return multipartResolver;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void extendMessageConverters(final List<HttpMessageConverter<?>> converters) {
|
||||
|
||||
Reference in New Issue
Block a user