Map<String, Object> requestMap = context.getExternalContext()
.getRequestMap();
for (Object key : beansMap.keySet()) {
Object bean = beansMap.get(key);
if (bean != null) {
KeepAlive annotation = bean.getClass().getAnnotation(KeepAlive.class);
if (annotation != null) {
if (!isAjax && annotation.ajaxOnly()) {
//skip ajax-only beans for non-ajax requests
continue;
}
}