I\'m developing web-application with JSF. I tested it as I was able to but from time to time runtime exceptions are thrown.
So, how to redirect user to special error
If you use java config in spring, you can follow,
@Configuration
public class ExcpConfig {
@Bean(name = "simpleMappingExceptionResolver")
public SimpleMappingExceptionResolver simpleMappingExceptionResolver() {
SimpleMappingExceptionResolver resolver= new SimpleMappingExceptionResolver();
Properties mappings = new Properties();
resolver.setExceptionMappings(mappings); // None by default
resolver.setExceptionAttribute("ErrorOccurred"); // Default is "exception"
resolver.setDefaultErrorView("500"); // 500.jsp
return r;
}
}