Skip to content

Commit

Permalink
#34 - add commons upload in order to allow file upload with wildfly8 …
Browse files Browse the repository at this point in the history
  • Loading branch information
cbellone committed Feb 15, 2015
1 parent 27f5fda commit 26a2d36
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,12 @@
<version>3.2</version>
</dependency>

<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.3.1</version>
</dependency>

<dependency>
<groupId>com.insightfullogic</groupId>
<artifactId>lambda-behave</artifactId>
Expand Down
9 changes: 3 additions & 6 deletions src/main/java/alfio/config/Initializer.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@
import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;

import javax.servlet.FilterRegistration.Dynamic;
import javax.servlet.*;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.SessionCookieConfig;

@Log4j2
public class Initializer extends AbstractAnnotationConfigDispatcherServletInitializer {
Expand Down Expand Up @@ -79,11 +81,6 @@ protected WebApplicationContext createRootApplicationContext() {
return ctx;
}

@Override
protected void customizeRegistration(ServletRegistration.Dynamic registration) {
registration.setMultipartConfig(new MultipartConfigElement(null, 1024000L, -1, 1024));
}

private void configureSessionCookie(ServletContext servletContext) {
SessionCookieConfig config = servletContext.getSessionCookieConfig();

Expand Down
6 changes: 3 additions & 3 deletions src/main/java/alfio/config/MvcConfiguration.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import org.springframework.security.web.csrf.CsrfToken;
import org.springframework.ui.ModelMap;
import org.springframework.web.multipart.support.StandardServletMultipartResolver;
import org.springframework.web.multipart.commons.CommonsMultipartResolver;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.LocaleResolver;
import org.springframework.web.servlet.ModelAndView;
Expand Down Expand Up @@ -221,8 +221,8 @@ public ObjectMapper objectMapper() {
}

@Bean
public StandardServletMultipartResolver multipartResolver() {
return new StandardServletMultipartResolver();
public CommonsMultipartResolver multipartResolver() {
return new CommonsMultipartResolver();
}


Expand Down

0 comments on commit 26a2d36

Please sign in to comment.