public static SpringSecurityExceptionTranslationFilter buildSpringSecurityExceptionFilter(
final AuthenticationEntryPoint aep,
@Inject @Value( "${spring-security.accessDenied.url}" ) final String accessDeniedUrl ) throws Exception {
SpringSecurityExceptionTranslationFilter filter = new SpringSecurityExceptionTranslationFilter();
filter.setAuthenticationEntryPoint( aep );
if ( !accessDeniedUrl.equals( "" ) ) {
T5AccessDeniedHandler accessDeniedHandler = new T5AccessDeniedHandler();
accessDeniedHandler.setErrorPage( accessDeniedUrl );
filter.setAccessDeniedHandler( accessDeniedHandler );
}
filter.afterPropertiesSet();
return filter;
}