package eu.europa.esig.dss.web.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.core.annotation.AnnotationUtils;
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;

@ControllerAdvice
public class GlobalExceptionHandler {

	public static final String DEFAULT_ERROR_VIEW = "error";

	@ExceptionHandler(value = Exception.class)
	public ModelAndView defaultErrorHandler(HttpServletRequest req, Exception e)
			throws Exception {
		// If the exception is annotated with @ResponseStatus rethrow it and let
		// the framework handle it (for personal and annotated Exception)
		if (AnnotationUtils.findAnnotation(e.getClass(), ResponseStatus.class) != null) {
			throw e;
		}

		ModelAndView mav = new ModelAndView();
		mav.addObject("exception", e);
		mav.addObject("url", req.getRequestURL());
		mav.setViewName(DEFAULT_ERROR_VIEW);
		return mav;
	}

}
@@ -84,16 +84,73 @@
 quest;%0A%0A
+import org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;%0A
 import o
@@ -201,16 +201,16 @@
 nUtils;%0A
-
 import o
@@ -505,16 +505,110 @@
 dler %7B%0A%0A
+%09private static final Logger logger = LoggerFactory.getLogger(GlobalExceptionHandler.class);%0A%0A
 %09public 
@@ -779,20 +779,17 @@
 ption e)
-%0A%09%09%09
+ 
 throws E
@@ -1042,13 +1042,83 @@
  e;%0A
-
 %09%09%7D%0A%0A
+%09%09logger.error(%22Unhandle exception occured : %22 + e.getMessage(), e);%0A%0A
 %09%09Mo

Add logger for uncatched exceptions