}
@Bean
- public ExceptionMappings exceptionMappings()
+ public DefaultExceptionHandler defaultExceptionHandler()
{
- return new ExceptionMappings();
+ return new DefaultExceptionHandler();
}
--- /dev/null
+package de.juplo.thymeproxy;
+
+
+import javax.servlet.http.HttpServletRequest;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.ControllerAdvice;
+import org.springframework.web.bind.annotation.ExceptionHandler;
+import org.springframework.web.bind.annotation.ResponseStatus;
+import org.springframework.web.servlet.ModelAndView;
+import org.thymeleaf.exceptions.TemplateInputException;
+
+
+
+/**
+ *
+ * @author Kai Moritz
+ */
+@ControllerAdvice
+public class DefaultExceptionHandler
+{
+ @ResponseStatus(HttpStatus.NOT_FOUND)
+ @ExceptionHandler(value = TemplateInputException.class)
+ public ModelAndView templateInputExceptionHandler(
+ HttpServletRequest request,
+ TemplateInputException e
+ )
+ {
+ ModelAndView mav = new ModelAndView("templates/404");
+ mav.addObject("template", e.getTemplateName());
+ mav.addObject("uri", request.getRequestURI());
+ return mav;
+ }
+}
+++ /dev/null
-package de.juplo.thymeproxy;
-
-
-import javax.servlet.http.HttpServletRequest;
-import org.springframework.http.HttpStatus;
-import org.springframework.web.bind.annotation.ControllerAdvice;
-import org.springframework.web.bind.annotation.ExceptionHandler;
-import org.springframework.web.bind.annotation.ResponseStatus;
-import org.springframework.web.servlet.ModelAndView;
-import org.thymeleaf.exceptions.TemplateInputException;
-
-
-
-/**
- *
- * @author Kai Moritz
- */
-@ControllerAdvice
-public class ExceptionMappings
-{
- @ResponseStatus(HttpStatus.NOT_FOUND)
- @ExceptionHandler(value = TemplateInputException.class)
- public ModelAndView templateInputExceptionHandler(
- HttpServletRequest request,
- TemplateInputException e
- )
- {
- ModelAndView mav = new ModelAndView("templates/404");
- mav.addObject("template", e.getTemplateName());
- mav.addObject("uri", request.getRequestURI());
- return mav;
- }
-}