Skip to content

Commit

Permalink
fix regression: always display custom error page instead of container…
Browse files Browse the repository at this point in the history
… error page
  • Loading branch information
cbellone committed Oct 18, 2016
1 parent e0057bf commit 3768b30
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/alfio/config/SpringBootInitializer.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@
import com.openhtmltopdf.util.XRLog;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.context.embedded.EmbeddedServletContainerCustomizer;
import org.springframework.boot.context.embedded.ErrorPage;
import org.springframework.boot.context.embedded.MimeMappings;
import org.springframework.boot.context.embedded.ServletContextInitializer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import org.springframework.core.env.ConfigurableEnvironment;
import org.springframework.http.HttpStatus;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.filter.CharacterEncodingFilter;

Expand Down Expand Up @@ -82,7 +84,7 @@ public EmbeddedServletContainerCustomizer embeddedServletContainerCustomizer() {
container.setSessionTimeout(2, TimeUnit.HOURS);
container.setMimeMappings(new MimeMappings(mimeMappings));

//container.addErrorPages(new ErrorPage(HttpStatus.NOT_FOUND, "/404-not-found"), new ErrorPage(HttpStatus.INTERNAL_SERVER_ERROR, "/500-internal-server-error"), new ErrorPage("/session-expired"));
container.addErrorPages(new ErrorPage(HttpStatus.NOT_FOUND, "/404-not-found"), new ErrorPage(HttpStatus.INTERNAL_SERVER_ERROR, "/500-internal-server-error"), new ErrorPage("/session-expired"));
};
}
}

0 comments on commit 3768b30

Please sign in to comment.