ContextHandler getContextHandler(AsyncContextEvent event) { if (event != null) { Context context = ((Context) event.getServletContext()); if (context != null) return context.getContextHandler(); } return null; }
/* ------------------------------------------------------------ */ public static SecurityHandler getCurrentSecurityHandler() { Context context = ContextHandler.getCurrentContext(); if (context == null) return null; return context.getContextHandler().getChildHandlerByClass(SecurityHandler.class); }
/** Set servlet context attributes that can be used in jsp. */ void setContextAttributes(Context ctx, Map<String, Object> contextAttrs) { for (Map.Entry<String, Object> e : contextAttrs.entrySet()) { ctx.setAttribute(e.getKey(), e.getValue()); } }