GitLab ist jetzt auf dem neuesten Stand! Die jüngsten Probleme wurden behoben. Wir entschuldigen uns für die dadurch verursachten Unannehmlichkeiten.

Commit 8d9a360f authored by Michael Menzel's avatar Michael Menzel

Setting tomcat max file size and added error redirect on too large file

parent 01044d7c
......@@ -26,8 +26,12 @@ import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.multipart.MultipartException;
import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler;
import javax.servlet.RequestDispatcher;
import javax.servlet.http.HttpServletRequest;
......@@ -112,6 +116,16 @@ public class ApplicationController implements ErrorController {
return "error";
public class FileErrorController extends ResponseEntityExceptionHandler {
String handleFileException(HttpServletRequest request, Throwable ex, Model model) {
model.addAttribute("errorMessage", "The file you tried to upload is too large. Please upload only files with a max. file size of 20 MB.");
return "error";
public String faq(){
......@@ -5,5 +5,6 @@
spring.mvc.favicon.enabled = false
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment