1 package de.juplo.thymeproxy;
4 import javax.servlet.http.HttpServletRequest;
5 import org.springframework.http.HttpStatus;
6 import org.springframework.web.bind.annotation.ControllerAdvice;
7 import org.springframework.web.bind.annotation.ExceptionHandler;
8 import org.springframework.web.bind.annotation.ResponseStatus;
9 import org.springframework.web.servlet.ModelAndView;
10 import org.thymeleaf.exceptions.TemplateInputException;
19 public class DefaultExceptionHandler
21 @ResponseStatus(HttpStatus.NOT_FOUND)
22 @ExceptionHandler(value = TemplateInputException.class)
23 public ModelAndView templateInputExceptionHandler(
24 HttpServletRequest request,
25 TemplateInputException e
28 ModelAndView mav = new ModelAndView("templates/404");
29 mav.addObject("template", e.getTemplateName());
30 mav.addObject("uri", request.getRequestURI());