/** * Handle the case when a {@link org.springframework.web.bind.WebDataBinder} conversion cannot occur. * <p>The default implementation sends an HTTP 500 error, and returns an empty {@code ModelAndView}. * Alternatively, a fallback view could be chosen, or the ConversionNotSupportedException could be * rethrown as-is. * @param ex the ConversionNotSupportedException to be handled * @param request current HTTP request * @param response current HTTP response * @param handler the executed handler * @return an empty ModelAndView indicating the exception was handled * @throws IOException potentially thrown from {@link HttpServletResponse#sendError} */ protected ModelAndView handleConversionNotSupported(ConversionNotSupportedException ex, HttpServletRequest request, HttpServletResponse response, @Nullable Object handler) throws IOException { sendServerError(ex, request, response); return new ModelAndView(); }
/** * Handle the case where a * {@linkplain org.springframework.http.converter.HttpMessageConverter message converter} * cannot write to a HTTP request. * <p>The default implementation sends an HTTP 500 error, and returns an empty {@code ModelAndView}. * Alternatively, a fallback view could be chosen, or the HttpMessageNotWritableException could * be rethrown as-is. * @param ex the HttpMessageNotWritableException to be handled * @param request current HTTP request * @param response current HTTP response * @param handler the executed handler * @return an empty ModelAndView indicating the exception was handled * @throws IOException potentially thrown from {@link HttpServletResponse#sendError} */ protected ModelAndView handleHttpMessageNotWritable(HttpMessageNotWritableException ex, HttpServletRequest request, HttpServletResponse response, @Nullable Object handler) throws IOException { sendServerError(ex, request, response); return new ModelAndView(); }
/** * Handle the case when a {@link org.springframework.web.bind.WebDataBinder} conversion cannot occur. * <p>The default implementation sends an HTTP 500 error, and returns an empty {@code ModelAndView}. * Alternatively, a fallback view could be chosen, or the ConversionNotSupportedException could be * rethrown as-is. * @param ex the ConversionNotSupportedException to be handled * @param request current HTTP request * @param response current HTTP response * @param handler the executed handler * @return an empty ModelAndView indicating the exception was handled * @throws IOException potentially thrown from {@link HttpServletResponse#sendError} */ protected ModelAndView handleConversionNotSupported(ConversionNotSupportedException ex, HttpServletRequest request, HttpServletResponse response, @Nullable Object handler) throws IOException { sendServerError(ex, request, response); return new ModelAndView(); }
/** * Handle the case where a * {@linkplain org.springframework.http.converter.HttpMessageConverter message converter} * cannot write to a HTTP request. * <p>The default implementation sends an HTTP 500 error, and returns an empty {@code ModelAndView}. * Alternatively, a fallback view could be chosen, or the HttpMessageNotWritableException could * be rethrown as-is. * @param ex the HttpMessageNotWritableException to be handled * @param request current HTTP request * @param response current HTTP response * @param handler the executed handler * @return an empty ModelAndView indicating the exception was handled * @throws IOException potentially thrown from {@link HttpServletResponse#sendError} */ protected ModelAndView handleHttpMessageNotWritable(HttpMessageNotWritableException ex, HttpServletRequest request, HttpServletResponse response, @Nullable Object handler) throws IOException { sendServerError(ex, request, response); return new ModelAndView(); }