I created a custom error page to replace the default whitelabel based on this tutorial. It worked fine but I need to pass other attributes to the page so I changed my code to intercept the error
endpoint based on the geoand's answer here.
Here is my final code:
@Controller
public class ErroHandlerController implements ErrorController {
@Value("${terena.midas.location}")
private String midasLocation;
@RequestMapping("/error")
public String handleError( Model model ) {
model.addAttribute( "midasLocation", midasLocation );
return "error";
}
@Override
public String getErrorPath() {
return "/error";
}
}
Well the code worked sending my variable midasLocation but I lost the error details like path, status,message, etc... How can I bring them back again?