return;
_context = SecurityContextHolder.getContext(); //get threadLocal from event thread
//handle Acegi Exception occured within Event handling
final Execution exec = Executions.getCurrent();
if (errs != null && !errs.isEmpty() && errs.size() == 1) {
Throwable ex = (Throwable) errs.get(0);
if (ex != null) {
ex = Exceptions.findCause(ex, AcegiSecurityException.class);
if (ex instanceof AcegiSecurityException) {
//ZK massage the exception to visual message (not an exception), so
//we remember the exception in request attribute and let ZkEventExceptionFilter
//to rethrow the exception so Acegi's ExcepitonTranslationFilter can
//catch that and show login window.
//to avoid show the massaged visula message
errs.clear();
exec.setAttribute(ZkEventExceptionFilter.EXCEPTION, ex);
exec.setAttribute(ZkEventExceptionFilter.COMPONENT, comp);
exec.setAttribute(ZkEventExceptionFilter.EVENT, evt);
}
}
}
//there was other exception, no need to go thru acegi filter chain.
if (errs != null && !errs.isEmpty()) return;
//carry the current event that would be used by the filter chain.
exec.setAttribute(ZkAuthenticationProcessingFilter.CURRENT_EVENT, evt);
Filter filter = (Filter) SpringUtil.getBean("zkFilterChainProxy");
if (filter != null) {
ServletRequest request = (ServletRequest) exec.getNativeRequest();
ServletResponse response = (ServletResponse) exec.getNativeResponse();
ServletResponse resp = BufferedResponse.getInstance(response, new NullWriter());
try {
filter.doFilter(request, resp, new NullFilterChain());
} catch(Exception ex1) {
throw UiException.Aide.wrap(ex1); //should never occur