@Override
	@RequestMapping(value = "${error.path:/error}", produces = "text/html")
	public ModelAndView errorHtml(HttpServletRequest request) {

		Integer status = (Integer) new ServletRequestAttributes(request).getAttribute(
				"javax.servlet.error.status_code", RequestAttributes.SCOPE_REQUEST);

		// TODO: better to toss this class completely and use an error page for 404
		switch (status) {
			case 404:
				return new ModelAndView(new RedirectView("/" + ConfigLocations.XD_ADMIN_UI_BASE_PATH + "/404.html"));
		}
		return super.errorHtml(request);
	}
{@link ErrorController} that causes 404 errors to be redirected to the Admin-UI 404 page.

@author Gunnar Hillert
spring-xd-dirt/src/main/java/org/springframework/xd/dirt/rest/XdErrorController.java