@@ -0,0 +1,2205 @@
+package fr.esiea.windmeal.controller.exception.handler;%0A%0Aimport fr.esiea.windmeal.model.exception.RestException;%0Aimport org.springframework.http.HttpStatus;%0Aimport org.springframework.http.ResponseEntity;%0Aimport org.springframework.web.bind.annotation.ControllerAdvice;%0Aimport org.springframework.web.bind.annotation.ExceptionHandler;%0Aimport org.springframework.web.context.request.WebRequest;%0Aimport org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler;%0A%0Aimport java.util.logging.Logger;%0A%0A/**%0A * Copyright (c) 2013 ESIEA M. Labusquiere D. D%C3%A9%C3%AFs%0A * %3Cp/%3E%0A * Permission is hereby granted, free of charge, to any person obtaining%0A * a copy of this software and associated documentation files (the%0A * %22Software%22), to deal in the Software without restriction, including%0A * without limitation the rights to use, copy, modify, merge, publish,%0A * distribute, sublicense, and/or sell copies of the Software, and to%0A * permit persons to whom the Software is furnished to do so, subject to%0A * the following conditions:%0A * %3Cp/%3E%0A * The above copyright notice and this permission notice shall be%0A * included in all copies or substantial portions of the Software.%0A * %3Cp/%3E%0A * THE SOFTWARE IS PROVIDED %22AS IS%22, WITHOUT WARRANTY OF ANY KIND,%0A * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF%0A * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND%0A * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE%0A * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION%0A * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION%0A * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.%0A */%0A@ControllerAdvice%0Apublic class ExceptionHandlerCtrl extends ResponseEntityExceptionHandler %7B%0A%0A%09private final static Logger LOGGER = Logger.getLogger(%22ExceptionHandlerCtrl%22);%0A%0A%09@ExceptionHandler(value = %7BRestException.class%7D)%0A%09protected ResponseEntity%3CObject%3E handleException(RestException ex, WebRequest request) %7B%0A%09%09LOGGER.info(%22An exception was catch by spring mvc :%22 + ex.getClass() + %22 : %22 + ex.getMessage());%0A%09%09Object model = ex.getModel();%0A%09%09return new ResponseEntity%3CObject%3E(model, HttpStatus.valueOf(ex.getStatus()));%0A%09%7D%0A%7D%0A

Add an exception handler to Spring Mvc (handling only RestException